Synthesize error “Missing Context for Property Implementation Declaration”

邮差的信 提交于 2019-11-28 02:37:08

问题


Anyone have any ideas? When I try to synthesize a property I have declared in the .h file its not letting me synthesize it. Any ideas? Thanks!


回答1:


This can happen when you attempt to synthesize a property outside of the scope of your class' implementation.

Incorrect:

@synthesize yourProperty;
@implementation YourClass
@end

Correct:

@implementation YourClass
@synthesize yourProperty;
@end



回答2:


It often happen when you use #import ,and does not on the top of file.



来源:https://stackoverflow.com/questions/7005390/synthesize-error-missing-context-for-property-implementation-declaration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!