iPhone开发常见错误:synthesized property ‘xxx’ must either be named the same…
这也是个iPhone开发初学者常犯的错误。原因是声明属性的时候,没有一个配套的私有属性。
@property (nonatomic,retain) IBOutlet XXX *xxx;
在类里如果不给他指定对应的私有属性,即使给属性赋值了,也无法保存,就会产生这个错误。
synthesized property ‘xxx’ must either be named the same as a compatible ivar or must explicitly name an ivar
不过这个错误在加入@synthesize xxx;以后才会出现。因为@synthesize会帮你生成一个getter和setter方法。
09月 27th, 2009 at 02:51 #Pavlosius
Блог очень качественный. Вручить бы Вам награду за него или просто почетный орден.