我是Xcode开发的新手,如果这是一个简单的修复,很抱歉。
重现此问题的步骤是
弹出菜单
*由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,
原因:'-[XYZMasterViewController setPreferredContentSize:]:无法识别
选择器发送到实例0x1d08fd10'
我怀疑该问题是由于与iOS 6和7之间的
main.m
相关或在其中的某些语法或配置更改所致-@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([XYZAppDelegate class]));
}
提前致谢
最佳答案
问题是setPreferredContentSize
is only available in IOS 7.0。您可以在代码中搜索preferredContentSize
,请记住,也许正在使用点表示法调用setPreferredContentSize
。
找到setPreferredContentSize
后,您应该执行以下操作:
if ([controller respondsToSelector:@selector(setPreferredContentSize:)])
{
// iOS 7
controller.preferredContentSize = ...;
}
else
{
// iOS < 7
controller.contentSizeForViewInPopover = ...;
}
关于ios - 在Xcode项目模板中定位iOS 6时,UIApplicationMain中出现错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20122623/