`

IOS UI考试试题(转载)

 
阅读更多

http://blog.sina.com.cn/s/blog_93c533fb0102veiq.html

 

※ 选择题(共25题,每题3分)

1、
当程序从后台将要重新回到前台的时候,会先执行以下哪个方法:
答案:(B)
A、- (void)applicationDidFinishLaunching:(UIApplication*)application{ }
B、- (void)applicationWillEnterForeground:(UIApplication *)application{ }
C、- (void)applicationDidBecomeActive:(UIApplication *)application{ }
D、 - (void)applicationWillTerminate:(UIApplication *)application{ }

2、
对于UISearchBar,要实现实时搜索(即搜索内容实时发生变化时),会执行以下哪个方法:
答案:(C)
A、- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar;
B、- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar;
C、- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ }
D、- (void)searchBarResultsListButtonClicked:(UISearchBar *)searchBar{ }

3、
以下的代码会出现什么问题:@implementation Person- (void)setAge:(int)newAge {  self.age = newAge;}@end
答案:(B)
A、会造成循环引用
B、会造成死循环
C、会出现内存泄露
D、会出现野指针

4、
以下不属于ios中实现多线程的方法是:
答案:(D)
A、NSThread
B、NSOperationQueue
C、Grand Central Dispatch(GCD)
D、NSURLRequest

5、
以下对多线程开发的理解错误的是:
答案:(B)
A、发挥多核处理器的优势,并发执行让系统运行的更快、更流畅,用户体验更好
B、多线程程序中,一个进程包含2个以上的线程(含2个)
C、大量的线程降低代码的可读性,但不需要更多的内存空间
D、当多个线程对同一个资源出现争夺的时候要注意线程安全的问题

6、
下面对UIView、UIWindow和CALayer理解错误的是:
答案:(C)
A、UIView继承于UIResponder
B、UIResponder继承于NSObject,UIView可以响应用户事件。
C、UIResponder继承与NSObject,CALayer继承于NSObject,CALayer可以响应事件。
D、UIView是用来显示内容的,可以处理用户事件,CALayer是用来绘制内容的,依赖与UIView来进行显示

7、
对于UIScrollViewController,scrollView将开始降速时,执行的方法是:
答案:(D)
A、- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;{ }
B、- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;{ }
C、- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView;{ }
D、- (void)scrollViewWillBeginDecelerating:

8、
对于UICollectionViewController,实现定义每个元素的margin(边缘 上-左-下-右) 的方法是:
答案:(B)
A、
- (CGSize)collectionView:(UICollectionView *)collectionView
 layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{  
 return CGSizeMake();  
}

B、
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView
 layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{  
 return UIEdgeInsetsMake();  
}

C、
- (CGSize)collectionView:(UICollectionView *)collectionView
 layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
{      
 return CGSizeMake();  
}

D、
- (CGSize)collectionView:(UICollectionView *)collectionView
 layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section
{  
 return CGSizeMake();  
}


9、
在MVC框架中,M与C通讯,通常使用什么方式?//M与C K与C都是通过KVO方式通讯
答案:(A)
A、KVO与通知
B、协议-代理
C、类目
D、属性

10、
以下关于导航栏外观属性对应的解释错误的是:
答案:(D)
A、barStyle bar的样式
B、translucent bar的透明度
C、backgroundImage bar的背景图片
D、barTintColor bar上控件的颜色  //改变导航栏的颜色

11、
实现一个singleton的类,下面正确的是:
答案:(A)
A、
static LOSingleton * shareInstance;
+ ( LOSingleton *)sharedInstance{
 @synchronized(self){
  if (shareInstance == nil) {
   shareInstance = [[self alloc] init];
  }
 }
 return shareInstance;
}

B、
static LOSingleton * shareInstance;
- ( LOSingleton *)sharedInstance{
 @synchronized(self){
  if (shareInstance == nil) {
   shareInstance = [[self alloc] init];
  }
 }
 return shareInstance;
}

C、
+ (LOSingleton *) sharedInstance
{
 LOSingleton *sharedInstance = nil ;
 static dispatch_once_t onceToken;  
 dispatch_once (& onceToken, ^ {  
  sharedInstance = [[self alloc] init];
 });
 return sharedInstance;
}

D、
- (LOSingleton *) sharedInstance
{
 static LOSingleton *sharedInstance = nil ;
 static  dispatch_once_t onceToken;  
 dispatch_once (& onceToken, ^ {  
  sharedInstance = [[self alloc] init];
 });
 return sharedInstance;
}


12、
以下哪个方法在当程序将要退出时被调用,且通常在此方法里写一些用来保存数据和一些退出前的清理工作。
答案:(B)
A、- (void)applicationExitsOnSuspend:(UIApplication *)application{ }
B、- (void)applicationDidEnterBackground:(UIApplication *)application{ }
C、- (void)applicationWillTerminate:(UIApplication *)application{ }
D、- (void)applicationDidFinishLaunching:(UIApplication *)application{ }

13、
获取tableview正在window上显示的cell的indexPath方法是:
答案:(B)
A、- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath;
B、- (NSArray *)indexPathsForVisibleRows;
C、- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
D、- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath;

14、
下面关于深拷贝与浅拷贝理解正确的是:
答案:(A)
A、深拷贝拷贝的是内容,浅拷贝拷贝的是指针。
B、深拷贝和浅拷贝最大的区别就是子类对象的地址是否改变。
C、深拷贝是对对象本身复制,但是不对对象的属性进行复制。
D、如果子类对象的地址改变那么就是深拷贝。

15、
很多内置类如UITableViewController的delegate属性都是assign而不是retain,这是为了:
答案:(D)
A、防止造成内存泄露
B、防止出现野指针
C、防止出现过度释放
D、防止循环引用

16、
关于OC内存管理方面说法错误的是:
答案:(B)
A、OC中的内存管理采用引用计数机制
B、autorelease pool 是OC中一种自动的垃圾回收机制
C、alloc、new或copy来创建一个对象,那么你必须调用release或autorelease
D、OC的内存管理机制本质上还是C语言中的手动管理方式,只不过稍加了一些自动方法

17、
关于系统自带的UITableViewCell,以下说法正确的是:
答案:(D)
A、Cell基本组成:编辑、内容、辅助
B、编辑:editView。tableView被编辑时显示
C、内容:contentView。包含imageView,textField等
D、accessoryView。显示cell的辅助信息

18、
应用程序启动顺序正确的是:①在UIApplication代理实例中重写启动方 法,设置第一个ViewController②程序入口main函数创建UIApplication实例和UIApplication代理实例③在第一个 ViewController中添加控件,实现对应的程序界面。
答案:(B)
A、①②③
B、②①③
C、①③②
D、③①②

19、
实现一个生成Student实例对象的便利构造器的正确写法是:
答案:(A)
A、
+ (id)studentWithName:(NSString *)newName andAge:(int)newAge
{
  Student *stu = [[[Student alloc] initWithName:newName andAge:newAge] autorelease];
  return stu;
}

B、
- (id)studentWithName:(NSString *)newName andAge:(int)newAge
{
  Student *stu = [[Student alloc] initWithName:newName andAge:newAge];
  return [stu autorelease];
}

C、
- (void)studentWithName:(NSString *)newName andAge:(int)newAge
{
  Student *stu = [[Student alloc] initWithName:newName andAge:newAge];
  return [stu autorelease];
}

D、
+ (void)studentWithName:(NSString *)newName andAge:(int)newAge
{
  Student *stu = [[Student alloc] initWithName:newName andAge:newAge];
  return [stu autorelease];
}


20、
以下关于视图的frame与bounds的理解错误的是:
答案:(A)
A、bounds是指这个view在window坐标系的坐标和大小
B、frame指的是这个view在它superview的坐标系的坐标和大小
C、frame和bounds是UIView中的两个属性(property)。
D、一个是以自身左上角的店为原点的坐标系,一个是以屏幕左上角的点为原点的坐标系。

21、
UITableView重用机制中,会将重用的cell放到哪种类型的集合中。
答案:(B)
A、NSMutableArray
B、NSMutableSet
C、NSDictionary
D、NSMutableDictionary

22、
当应用程序将要进入非活动状态执行,在此期间,应用程序不接收消息或事件,比如来电话了,此时会先执行以下哪个方法:
答案:(D)
A、- (void)applicationDidBecomeActive:(UIApplication *)application{ }
B、- (void)applicationDidEnterBackground:(UIApplication *)application{ }
C、- (void)applicationWillTerminate:(UIApplication *)application{ }
D、- (void)applicationWillResignActive:(UIApplication *)application{ }

23、
以下哪个控件不是继承于UIControl
答案:(D)
A、UIButton
B、UITextField
C、UISlider
D、UITextView

24、
对于UISegmentedControl,实现在指定索引插入一个选项并设置图片的方法是:
答案:(B)
A、[segmentedControl setImage:[UIImage imageNamed:@"btn_jyy.png"] forSegmentAtIndex:3];
B、[segmentedControl insertSegmentWithImage:[UIImage imageNamed:@"mei.png"] atIndex:2 animated:NO];
C、[segmentedControl insertSegmentWithTitle:@"insert" atIndex:3 animated:NO];
D、[[UIImageViewalloc]initWithImage:[segmentedControl imageForSegmentAtIndex:1]];

25、
对于UIScrollViewController,监控目前滚动的位置的属性是:
答案:(A)
A、contentOffSet
B、contentSize
C、contentInset
D、scrollIndicatorInsets

※ 判断题(共5题,每题3分)

1、
UISlider、UISwitch、UITextField这些类都继承于UIControl这个类。
答案:(T)
正确
错误

2、
[segmentedControl titleForSegmentAtIndex: ]表示指定索引文字的选项。
答案:(T)
正确
错误

3、
[self.view popToViewController: animated: YES];表示弹出一个视图控制器,到指定视图控制器上。
答案:(F)
正确
错误

4、
[textField resignFirstResponder]; 表示让文本输入框成为第一响应者, 弹出键盘进入编辑模式。
答案:(F)
正确
错误

5、
numberOfTapsRequired这个方法能获取到的是有几只手指点击。
答案:(F)
正确
错误

 

 

分享到:
评论

相关推荐

    sketch IOS UI组件库

    Sketch IOS UI组件库,安装即可自动加载到Sketch中,省去自己建库的时间。

    iOS UI开发详解

    深入讲解iOS开发入门以及应用,重点讲解了UI设计方面的相关基础及实例;包含多套原版资料以及详实的案例分享,可查看同名资料,绝对超值。

    猫猫学ios UI抽屉效果

    猫猫学ios UI抽屉效果 注释齐全,完成抽屉效果的简单实现

    IOS UI设计源码

    《 IOS 开发学习(3): IOS UI架构设计》 博文的源码, 博文地址:http://blog.csdn.net/ostrichmyself/article/details/8277883

    ios ui设计

    ios ui设计,里面是ios的各种控件的psd源文件。

    仿IOSUI动画

    模仿IOS的UI动画,有4个效果,弹窗,对话框等等,有兴趣的可以下载看看

    Learning iOS UI Development

    Learning iOS UI DevelopmentLearning iOS UI DevelopmentLearning iOS UI Development

    iosUI控件的使用

    包含collectionView,UIBezierPath,ActionSheet,DatePicker,pickerView,SearchBar,UIActivityIndicatorView,UIAlertView,UIButton,UIimagePicker,UILabel,UInavigationController,UIProgressView,UIScrollerView,...

    iOSUI基础控件常用方法探微

    IOS开发中,基础是UI控件,控件的使用离不开方法。归纳其常用的方法,有所裨益

    iOS_UI设计指南

    UI设计 UI指南 UI iOS ios 不管你是哪个系统下的开发,我想你都是要学习人家iOS下的UI设计的。看看无害

    axure ios7UI元件

    axure ios7 UI元件库 组件

    各种IOS UI小控件使用基本方法

    各种IOS UI小控件使用基本方法 适合基础学习

    IOS UI简易纸牌游戏

    IOS UI界面 简易纸牌游戏 翻牌游戏 小游戏 课件

    ios UI 画画板

    ios UI 画画板ios UI 画画板 自己用代码实现的画画板功能

    iOS注册UI案例

    猫猫自己做的iOS注册UI案例 代码和注释充分 分享给大家学习

    iOS9 UI Tests UI自动化测试 demo

    iOS9 UI Tests UI自动化测试 demo 这篇文章详细讲解了原理以及如何操作 http://blog.csdn.net/zhao18933/article/details/46621999 demo中还提供了另外一种进行自动化测试的思路

    iOS端UI设计文档

    iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档iOS端UI设计文档

    网易云信iOS UI组件源码仓库.zip

    网易云信iOS UI组件源码仓库.zip,网易云信 iOS UI 组件,提供聊天界面,文本消息,图片消息,语音消息,视频消息,地理位置消息,自定义消息(阅后即焚)等消息示例

    ios UI设计

    ios设计非官方参考,包括屏目尺寸,按钮大小,字体大小,图标大小 可作为参考标准

    Learning.iOS.UI.Development.17852881

    Through this comprehensive one-stop guide, you'll get to grips with the entire UIKit framework and in a flash, you'll be creating modern user interfaces for your iOS devices using Swift. Starting ...

Global site tag (gtag.js) - Google Analytics