今天在给类的属性命名的时候,用了newValue,就给报错: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, alloc
, newObject
,
or mutableCopy
).
一定要注意命名规范,不能以alloc,new,copy,mutableCopy 作为开头命名,比如:newValue。留此做个笔记,纪念一下。
版权声明:本文为博主原创文章,未经博主允许不得转载。
小胖说事24-----property's synthesized getter follows Cocoa naming convention for returning 'owned' objec
时间: 2024-11-07 15:16:24