您的位置:首页 > 移动开发 > Objective-C

Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

2014-03-28 15:10 567 查看
Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

这个出处:@synthesize newPwd;

违犯了ARC命名规则,成员变量不要以new作为前缀。

关于ARC规则,请参考http://mobile.51cto.com/iphone-313122.htm

基本的ARC使用规则:

1。代码中不能使用retain, release, retain, 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”)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐