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

后端 未结 2 1632
无人及你
无人及你 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.

提交回复
热议问题