iOS5 Stable App Crashing in iOS4.3 Simulator

走远了吗. 提交于 2019-12-19 15:44:19

问题


i am getting an NSInvalidArgumentException with reason: -[UITapGestureRecognizer initWithCoder:]: unrecognized selector sent to instance

my understanding was that UITapGestureRecognizers were supported in ios4.x?

is it possible to load a different xib file for sub ios5 versions?


回答1:


As @mit3z states in his comment on the original question, iOS 4.3 supports this feature only when setup up manually with code. It is not supported with Interface Builder.

Apple would have saved us all grief over this if they simply added this as a build-time warning.




回答2:


I think you have a NSCoding compliant object that is deallocated before the crash. The UITapGestureRecognizer is allocated at its address and when the disappeared object (but not its reference) tries to call initWithCoder on itself, it actually calls this method on your gestureRecognizer instead.

Then your problem comes from that deallocated object but not from your gestureRecognizer.

Be sure to retain all your IBOutlet properties.



来源:https://stackoverflow.com/questions/9019420/ios5-stable-app-crashing-in-ios4-3-simulator

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