gpt4 book ai didi

iphone - ios 应用程序中的 setPreferredContentSize 错误

转载 作者:可可西里 更新时间:2023-11-01 04:06:11 24 4
gpt4 key购买 nike

在为 iPad 模拟器启动时,在 xcode 5 中创建“IOS 项目”会导致以下情况。该应用程序适用于 iPhone 配置。我已将目标设置为 5 及更高版本,并删除了自动布局,因为它与 ios/xcode 5 不兼容。

我在启动 iPad 应用程序时遇到以下错误。

2013-08-29 08:53:57.688 IOS Project[350:c07] -[MasterViewController    setPreferredContentSize:]: unrecognized selector sent to instance 0x9e2cc20
2013-08-29 08:53:57.692 IOS Project[350:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MasterViewController setPreferredContentSize:]: unrecognized selector sent to instance 0x9e2cc20'
*** First throw call stack:
(0x1cd012 0x14c4e7e 0x2584bd 0x1bcbbc 0x1bc94e 0xbe7b 0x624d36 0x85054a 0x8506c3 0x40871e 0x4089a2 0x407876 0x418cb5 0x419beb 0x40b698 0x1f5fdf9 0x1f5fad0 0x142bf5 0x142962 0x173bb6 0x172f44 0x172e1b 0x40717a 0x408ffc 0x6d3d 0x6ca5)

最佳答案

虽然接受的答案在确定问题方面是正确的,但我不会检查特定的设备版本,而是使用类似的东西

if ( [self respondsToSelector:@selector(setPreferredContentSize:)] ) ...

关于iphone - ios 应用程序中的 setPreferredContentSize 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18502006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com