iOS 对象属性参数名定义的注意事项不能以alloc,new,copy,mutableCopy 作为开头命名

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


You own any object you create

You create an object using a method whose name begins with “alloc”, “new”, “copy”, or “mutableCopy” (for example, <a style="color: #003366; text-decoration: none;" target="_self" href="http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/clm/NSObject/alloc">alloc</a>newObject, or <a style="color: #003366; text-decoration: none;" target="_self" href="http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/mutableCopy">mutableCopy</a>).

一定要注意命名规范,不能以alloc,new,copy,mutableCopy 作为开头命名,比如:newPassword,

ios

相关推荐