Synthesize error “Missing Context for Property Implementation Declaration”

后端 未结 2 693
一生所求
一生所求 2020-12-18 19:36

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!

相关标签:
2条回答
  • 2020-12-18 20:14

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

    0 讨论(0)
  • 2020-12-18 20:23

    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
    
    0 讨论(0)
提交回复
热议问题