xCode 6 how to fix “Use of undeclared identifier” for automatic property synthesis?

前端 未结 3 2081
后悔当初
后悔当初 2020-12-15 02:32

I\'m using xCode6 Beta 3, and am running into an issue where a code which previously compiled fine (xCode 5.1.1 or xCode6 beta 2) suddenly started to give me \"Use o

相关标签:
3条回答
  • 2020-12-15 03:27

    At first I thought it was a beta version bug, but today I saw that this type of errors occur on the XCode 6 GM Seed also, though I'm yet to discover in which particular cases.

    Anyway, the fix is to add a synthesize statement in the @implementation block, explicitly declaring the name of the ivar as well as the property:

    @synthesize property = _property
    
    0 讨论(0)
  • 2020-12-15 03:30

    If you have an explicit getter, automatic property synthesized will be ignored.

    Then you have to use @synthesize property = _property

    0 讨论(0)
  • 2020-12-15 03:39

    pod update

    then your can now update to 3.7.1 that has fixed this bug.

    0 讨论(0)
提交回复
热议问题