在做iPhone开发过程中,收集了一些常见到问题,可以用作面试题目,供大家参考,如果这些问题对你来说完全没有难度,可以发一份简历到 join@mapiz.com
- ObjC中,与alloc语义相反的方法是dealloc还是release?与retain语义相反的方法是dealloc还是release,为什么?需要与alloc配对使用的方法是dealloc还是release,为什么?
- 在一个对象的方法里面:
self.name = “object”;
和
name =”object”
有什么不同吗? -
这段代码有什么问题吗:@implementation Person- (void)setAge:(int)newAge {self.age = newAge;}@end
- 什么是retain count?
- 以下每行代码执行后,person对象的retain count分别是多少
Person *person = [[Person alloc] init];
[person retain];
[person release];
[person release]; - 为什么很多内置类如UITableViewController的delegate属性都是assign而不是retain的?
- 定义属性时,什么情况使用copy,assign,和retain
- autorelease的对象是在什么时候被release的?
- 这段代码有什么问题,如何修改
for (int i = 0; i < someLargeNumber; i++)
{
NSString *string = @”Abc”;
string = [string lowercaseString];
string = [string stringByAppendingString:@"xyz"];
NSLog(@“%@”, string);
} - autorelease和垃圾回收机制(gc)有什么关系?
- IPhone OS有没有垃圾回收(gc)?
- 什么是Notification?
- 什么时候用delegate,什么时候用Notification?
- 什么是KVC和KVO?
- Notification和KVO有什么不同?
- KVO在ObjC中是怎么实现的?
- ViewController 的 loadView, viewDidLoad, viewDidUnload 分别是在什么时候调用的?在自定义ViewController的时候这几个函数里面应该做什么工作?
- ViewController 的 didReceiveMemoryWarning 是在什么时候被调用的?默认的操作是什么?
- 未完待续…
相关文章:
/pandora/img/logo.top.png)