ARC下@property参数的变化
strong:相当于非ARC机制下使用的retain
weak:相当于非ARC机制下使用的assign(但是在ARC下OC对象也可以使用)
assign:这个关键字依然可以使用,还是针对非OC对象使用
总结:
在ARC机制下
1》代码中不能使用retain, release, autorelease
2》不重载dealloc(如果是释放对象内存以外的处理,是可以重载该函数的,但是不能调用[super dealloc])
3》不能使用NSAllocateObject, NSDeallocateObject
4》不能在C结构体中使用对象指针
5》id与void * 间的如果cast时需要用特定的方法(__bridge关键字)
6》不能使用NSAutoReleasePool、而需要@autoreleasepool块
7》不能使用“new”开始的属性名称 (如果使用会有下面的编译错误”Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects”)