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

来源:互联网 发布:网络骂人用语2017 编辑:程序博客网 时间:2024/05/22 02:54
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”)
0 0
原创粉丝点击