To be or not to be.That is a question!

---源于莎士比亚的《哈姆雷特》

导航

2013年9月22日 #

引用计数(retainCount)

摘要: ClassA.h:#import @interface ClassA:NSObject{ NSString *name;}-(void)setName:(NSString*)s;-(NSString*)name;-(void)dealloc;@endClassA.m:#import "ClassA.h"@implementation ClassA-(void)setName:(NSString *)s{ name=s; [name retain];}-(NSString*)name{ return name;}-(void)dealloc{ NSLog(@"del 阅读全文

posted @ 2013-09-22 16:39 Ijavascript 阅读(520) 评论(0) 推荐(1) 编辑

集合对象(NSSet)

摘要: main.m#import @interface NSSet(printInteger)-(void)printSet;@end@implementation NSSet(printInteger)-(void)printSet{ for (NSNumber *integer in self) { printf("%i",[integer integerValue]); } printf("\n");}@endint main(void){ @autoreleasepool { NSMutableSet *set1=[NSMutableSet... 阅读全文

posted @ 2013-09-22 10:52 Ijavascript 阅读(247) 评论(0) 推荐(0) 编辑