setPreferredContentSize error in ios app
Creating "IOS Project" in xcode 5 causes the following when launching for iPad simulator. The application works for iPhones configuration. I have set the target to be 5 and later and removed autolayout as its not compatible with ios/xcode 5.
I get the following error at launch of iPad app.
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)
In iOS7, UIViewController has a new property preferredContentSize. A project made for iOS7 has the following method:
- (void)awakeFromNib
{
self.preferredContentSize = CGSizeMake(320.0, 480.0);
[super awakeFromNib];
}
It therefore sends a setPreferredContentSize: message to your own controller, no matter if the property is implemented or not. To resolve the issue, you might want to avoid setting a property that does not exist:
- (void)awakeFromNib
{
if ([[[UIDevice currentDevice] systemVersion] compare:@"" options:NSNumericSearch] != NSOrderedAscending) {
self.preferredContentSize = CGSizeMake(320.0, 480.0);
}
[super awakeFromNib];
}
http://stackoverflow.com/questions/18502006/setpreferredcontentsize-error-in-ios-app
setPreferredContentSize error in ios app的更多相关文章
- -canOpenURL: failed for URL: "" - error: "(null)" , iOS9 App传输安全 支持http 解决方案
-canOpenURL: failed for URL: "CamCardHDOpenAPI:*" - error: "(null)" This app is ...
- ios app 实现热更新(无需发新版本实现app添加新功能)
目前能够实现热更新的方法,总结起来有以下三种 1. 使用FaceBook 的开源框架 reactive native,使用js写原生的iOS应用 ios app可以在运行时从服务器拉取最新的js文件到 ...
- iOS App从点击到启动
程序启动之前 从exec()开始 main()函数是整个程序的入口,在程序启动之前,系统会调用exec()函数.在Unix中exec和system的不同在于,system是用shell来调用程序,相当 ...
- 如何用 React Native 创建一个iOS APP?(三)
前两部分,<如何用 React Native 创建一个iOS APP?>,<如何用 React Native 创建一个iOS APP (二)?>中,我们分别讲了用 React ...
- 改变iOS app的icon(iOS10.3)
改变iOS app的icon 官方 iOS10.3新增了可以让开发者去更改app的icon,接下来看看怎么更改. 官方API给的东西很少,只是介绍了一个实例方法: open func setAlter ...
- hbuilder IOS APP 打包与发布2
在上一篇的<hbuilder IOS APP 打包与发布>中,请求 的 是APP ids . ios开发证书 .和开发配置文件 , 这一篇中就不写发布证书和配置文件的请求,因为流程 ...
- iOS App的加固保护原理
本文由 网易云发布. 本文从攻防原理层面解析了iOS APP的安全策略.iOS以高安全性著称,但它并非金刚不坏之身.对于信息安全而言,止大风于青萍之末是上上策,杭研深入各个细节的研发工作,正是网易产 ...
- ios app 实现热更新(无需发新版本号实现app加入新功能)
眼下可以实现热更新的方法,总结起来有下面三种 1. 使用FaceBook 的开源框架 reactive native,使用js写原生的ios应用 ios app能够在执行时从server拉取最新的js ...
- 25条提高iOS App性能的技巧和诀窍
25条提高iOS App性能的技巧和诀窍 当我们开发iOS应用时,好的性能对我们的App来说是很重要的.你的用户也希望如此,但是如果你的app表现的反应迟钝或者很慢也会伤害到你的审核. 然而,由于IO ...
随机推荐
- 笔记 Bioinformatics Algorithms Chapter7
一.Lloyd算法 算法1 Lloyd Algorithm k_mean clustering * Centers to Clusters: After centers have been selec ...
- maven之web工程的搭建
参考之前jave application的工程创建的步骤,我们只需要修改最后一步 这样就创建了个web maven工程 与java application应用程序的区别,还有别的区别这里不做多的阐述. ...
- IntelliJ IDEA配置Tomcat(完整版教程)
查找该问题的童鞋我相信IntelliJ IDEA,Tomcat的下载,JDK等其他的配置都应该完成了,那我直接进入正题了. 1.新建一个项目 2.由于这里我们仅仅为了展示如何成功部署Tomcat,以及 ...
- user_agent
public function getipinfo($ip) { $res = '其他'; $url = "http://int.dpool.sina.com.cn/iplookup/ipl ...
- 《mysql必知必会》学习_第五章_20180730_欢
使用的工具是wamp的Mysql. P29 select prod_name from products; #在表products中选列prod_name,顺寻不是纯粹的随机,但是没有说明排列顺序, ...
- 10.Date对象
Date()对象 Date对象用于处理日期和时间. Math对象 ◆Math.ceil() 天花板函数 向上取整 ★如果是整数,取整之后是这个数本身 ★如果是小数,对数进行向上舍入. ◆Ma ...
- await和async在C#一般处理程序(ashx)中的使用
public class hello : HttpTaskAsyncHandler, IReadOnlySessionState { public IFetchServise fetch { get; ...
- BAE上部署Ghost 0.5.1注意事项
BAE上部署Ghost可参考基本安装上述安装使用的是ghost0.4.7版本 在ghost 0.5 中为了解决测试时事件侦听器过多引发的警告,在注册single事件时,将代码由原先的 process. ...
- IIS伪静态配置,使用URLRewriter实现伪静态
前段时间开发公司官网,用到了URLRewriter实现伪静态,在VS调试模式下没有任何问题,部署到IIS上后总是提示404的错误,查了很久才知道IIS需要做相应的配置才能实现动态跳转的功能,现将IIS ...
- MVC 视图不使用模板页的两种方法
直接对view页面的Layout值设置null @{ Layout = null;//"~/Views/Shared/_Layout.cshtml"; } 对_ViewStart. ...