Property 'x' not found on object of type 'y *' error only with ARC

后端 未结 2 1614
无人及你
无人及你 2020-12-22 09:47

This error very strange. I have a bunch of properties in app delegate which I have no problem to access. My code worked fine without ARC, but when I turned on ARC I receive

相关标签:
2条回答
  • 2020-12-22 10:16

    OK, I put only the problematic code into a empty project as seen in the question. It compiles fine. It's really puzzling so I concluded it must be a bug in Xcode, or maybe some settings. Anyways I couldn't figure out what went wrong so I just pass the problematic object (navigationController) when MyClass is instantiated in AppDelagate. It's fine with one object and thankfully all the other appDelegate properties/selectors can be accessed fine.

    0 讨论(0)
  • In MyClass.m, you are importing "MyClass" instead of "MyClass.h". Could this be the problem?

    Sometimes cleaning a project is not sufficient: you may need to open the Organizer window, select your project under the Projects tab, and click the button to delete Derived Data.

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