IOS开发笔试题目
一、OC语法部分:
1、 NSObject 中description属性的意义,它可以重写吗
@interface Person : NSObject
{
NSString * name;
int age;
}
@implementation Person
- (instancetype)init
{
self = [super init];
if (self) {
name = @"老李";
age = 28;
}
returnself;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"姓名:%@ ,年龄:%d", name,age];
}
Person * laoli = [Person new];
NSLog(@"%@",laoli);
姓名:老李,年龄:28
<Person: 0x10010bbd0>
2、
原文地址:http://www.cnblogs.com/yehot/p/3757771.html