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

早过忘川 提交于 2019-11-29 18:07:25

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.

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.

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