开发者

Running universal iOS app on iPad tries to call iPhone-only class

开发者 https://www.devze.com 2023-04-05 14:21 出处:网络
I am currently writing an app on xCode, for both iPhone and iPad. It is universal. I have finished the iPhone part, but I am stuck for 2 days on iPad part. I have created all the views etc for iPad, d

I am currently writing an app on xCode, for both iPhone and iPad. It is universal. I have finished the iPhone part, but I am stuck for 2 days on iPad part. I have created all the views etc for iPad, different from iPhone one. When I connect a button on iPad view controller to a iPad view, it just crashes:

[Terminating app due to uncaught exception, [HelloiciousViewController aboutWindowOpener]: unrecognized selector sent to inst开发者_开发百科ance 0x5b7c180.

HelloiciousViewController is the iPhone view controller, the main one, and I have nothing to do with it on iPad. But it somehow connects to it and tries to launch aboutWindowOpener method on it. My iPad aboutWindow open method is aboutWindowAc . Checked everything ten times, it has nothing to do with iPhone interface. Why does this happen?


Describe the approach that you took to do the universal app. Do you have two appDelegates? In anyway, make sure in the plist you define both the iPhone and iPad Main .xib files with the keys NSMainNibFile and NSMainNibFile~ipad

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号