码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发——面试笔试精华(三)

时间:2015-06-24 22:24:15      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

面试笔试精华(三)

1.        When to use NSMutableArray and when to use NSArray? 什么时候使用NSMutableArray,什么时候使用NSArray?

1>   当数组元素需要动态地添加或者删除时,用NSMutableArray

2>   当数组元素固定不变时,用NSArray

 

2.       Give us example of what are delegate methods and what are data source methods of uitableview. 给出委托方法的实例,并且说出UITableVIew的Data Source方法

1>  代理方法:返回tableView每行的高度、监听tableView每行的选中

2>  数据源方法:返回tableView数据的组数和行数、每行显示什么数据

3>  UITableVIew的Data Source方法有- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

4>  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

3.      How many autorelease you can create in your application? Is there any limit? 在应用中可以创建多少autorelease对象,是否有限制?

没有限制

 

4.      If we don’t create any autorelease pool in our application then is there any autorelease pool already provided to us? 如果我们不创建内存池,是否有内存池提供给我们?

系统会默认会不定时地创建和销毁自动释放池

 

5.      When you will create an autorelease pool in your application? 什么时候需要在程序中创建内存池?

当需要精确地控制对象的释放时间时,需要手动创建自动释放池

 

6.        When retain count increase? 什么时候内存计数会增加?

当做一次retain或者copy操作,都有可能增加计数器

 

7.       What are commonly used NSObject class methods? 类NSObject的那些方法经常被使用?

NSObject常见的类方法有:alloc、new、description等

8.      What is convenience constructor? 什么是简便构造方法?

像NSStirng的stringWithFormat,NSNumber的numberWithInt

 

9.      How to design universal application in Xcode? 如何使用Xcode设计通用应用?

1>   创建项目时,Device选择Universal

2>   可以创建一套通用的数据模型

3>   根据iPhone\iPad选择不同的控制器(iPad可能用UISplitViewController)

4>   根据iPhone\iPad选择不同的界面

 

10.    What is keyword atomic in Objective C? 在Objetive-C什么是原子关键字

1>  atomic是原子性

2>  atomic会对set方法的实现进行加锁

 

11.    What are UIView animations? UIView的动画效果有那些

UIView封装的核心动画可以通过类方法\block实现

 

12.    How can you store data in iPhone applications? 在iPhone应用中如何保存数据?

1>   属性列表

2>   Preference(NSUserDefaults)

3>   键值归档(NSKeyedArchiver、NSCoding)

4>   SQLite数据库

5>   Core Data

 

13.    What is NSManagedObject model? 什么是NSManagedObject模型?

NSManagedObject是Core Data中的实体对象

 

14.    What is predicate? 什么是谓词?

谓词:可以以一定条件来过滤数组、字典等集合数据,也能用在Core Data的数据查询中

 
 

iOS开发——面试笔试精华(三)

标签:

原文地址:http://www.cnblogs.com/iCocos/p/4598716.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!