摘要:
assign:默认参数setter 方法不会引起引用计数的变化retain:setter方法首先释放旧的对象,将旧对象的值赋予输入对象,再提高输入对象的引用计数为1copy:setter 方法首先建立了一个相同的对象,先对象引用计数为1旧对象引用计数无变化ARC中strong==retainweak... 阅读全文
posted @ 2015-06-08 20:19
来自大山深处的菜鸟
阅读(420)
评论(0)
推荐(0)
摘要:
autoreleasepool 池子被销毁的时候被标记 autorelease 的对象调用一次releasePerson *p2=[[[Person alloc]init]autorelease];标记为autoreleaseassign默认参数,setter方法不会引起引用计数的变化retain ... 阅读全文
posted @ 2015-06-08 19:17
来自大山深处的菜鸟
阅读(240)
评论(0)
推荐(0)
摘要:
NSDate 表达日期表达时间的方法NSDate *now=[NSDate date]; 获得当前日期NSDate *tomrrow=[now dateByAddingTimeInterval:24*60*60];NSComparisonResulte result =[now compare:to... 阅读全文
posted @ 2015-06-08 13:02
来自大山深处的菜鸟
阅读(117)
评论(0)
推荐(0)
摘要:
NSNumber 是一个数值类型封装起来的数值。装箱:基础类型->对象类型NSNumber *number=[NSNumber numberWithInt:12];拆箱:对象类型->对象类型int a = [num intValue];NSintegerNSValue 是NSNumber 父类 不可... 阅读全文
posted @ 2015-06-08 11:50
来自大山深处的菜鸟
阅读(199)
评论(0)
推荐(0)
摘要:
无序集合 哈希表NSSet *colors=[NSSet setWithObjects:@@"yellow",@"red",@"blue",@"black",nil];NSArray *array=[colors allObjects];NSString *obj = [colors anyObje... 阅读全文
posted @ 2015-06-08 11:19
来自大山深处的菜鸟
阅读(145)
评论(0)
推荐(0)
摘要:
存储对象都必须是id(对象类型)不能使基础类型NSDictionary *scores=[[NSDictionary alloc]initWithObjectsAndKeys:@"89",@"english",@"70",@"computer",nil];*scores=[[NSDictionary... 阅读全文
posted @ 2015-06-08 10:56
来自大山深处的菜鸟
阅读(395)
评论(0)
推荐(0)

浙公网安备 33010602011771号