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的更多相关文章

  1. -canOpenURL: failed for URL: "" - error: "(null)" , iOS9 App传输安全 支持http 解决方案

    -canOpenURL: failed for URL: "CamCardHDOpenAPI:*" - error: "(null)" This app is ...

  2. ios app 实现热更新(无需发新版本实现app添加新功能)

    目前能够实现热更新的方法,总结起来有以下三种 1. 使用FaceBook 的开源框架 reactive native,使用js写原生的iOS应用 ios app可以在运行时从服务器拉取最新的js文件到 ...

  3. iOS App从点击到启动

    程序启动之前 从exec()开始 main()函数是整个程序的入口,在程序启动之前,系统会调用exec()函数.在Unix中exec和system的不同在于,system是用shell来调用程序,相当 ...

  4. 如何用 React Native 创建一个iOS APP?(三)

    前两部分,<如何用 React Native 创建一个iOS APP?>,<如何用 React Native 创建一个iOS APP (二)?>中,我们分别讲了用 React ...

  5. 改变iOS app的icon(iOS10.3)

    改变iOS app的icon 官方 iOS10.3新增了可以让开发者去更改app的icon,接下来看看怎么更改. 官方API给的东西很少,只是介绍了一个实例方法: open func setAlter ...

  6. hbuilder IOS APP 打包与发布2

    在上一篇的<hbuilder IOS APP 打包与发布>中,请求 的 是APP ids .  ios开发证书 .和开发配置文件  ,   这一篇中就不写发布证书和配置文件的请求,因为流程 ...

  7. iOS App的加固保护原理

    本文由  网易云发布. 本文从攻防原理层面解析了iOS APP的安全策略.iOS以高安全性著称,但它并非金刚不坏之身.对于信息安全而言,止大风于青萍之末是上上策,杭研深入各个细节的研发工作,正是网易产 ...

  8. ios app 实现热更新(无需发新版本号实现app加入新功能)

    眼下可以实现热更新的方法,总结起来有下面三种 1. 使用FaceBook 的开源框架 reactive native,使用js写原生的ios应用 ios app能够在执行时从server拉取最新的js ...

  9. 25条提高iOS App性能的技巧和诀窍

    25条提高iOS App性能的技巧和诀窍 当我们开发iOS应用时,好的性能对我们的App来说是很重要的.你的用户也希望如此,但是如果你的app表现的反应迟钝或者很慢也会伤害到你的审核. 然而,由于IO ...

随机推荐

  1. Tensflow预测股票实例

    import pandas as pd import numpy as np import matplotlib.pyplot as plt import tensorflow as tf #———— ...

  2. XML xmlns

    xmlns xml namespaces 参考 http://www.w3school.com.cn/tags/tag_prop_xmlns.asp http://www.w3school.com.c ...

  3. CentOS 利用Yum安装mysql后无法启动(MySQL Daemon failed to start.)

    安装mysql-server [root@iZwz9cl4i8oy1reej7o8pmZ ~]# yum install -y mysql-server 进入/etc执行mysql_install_d ...

  4. winSocket编程(九)重叠IO

    重叠模型的优点 重叠模型的基本原理 关于重叠模型的基础知识 重叠模型的实现步骤 多客户端情况的注意事项 一.重叠模型的优点 1.可以运行在支持Winsock2的所有Windows平台 ,而不像完成端口 ...

  5. ubuntu 开机自启(2B的经历)

    上午写了很细致的开机自启说明文档(需打开terminal进行输出认证).睡了一下午,回来楼主说,联想PM要用Ubuntu Server 当服务器,必须用命令行实现.. 连续各种百度谷歌,看了N多文档, ...

  6. android 发送url带中文出现乱码怎么解决

    上传的时候参数中带中文的时候发送参数的时候就有可能出现乱码,这种情况怎么解决呢,就是设置url的格式为utf-8 httpRequest.setEntity(new UrlEncodedFormEnt ...

  7. Legal or Not HDU

    Legal or Not Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tot ...

  8. ASP.NET MVC Bundles 合并压缩(js css)

    Chrome浏览器有并发的Http请求限制,Bundles可以将多个JS文件合并成一个文件并进行压缩,最终得到一个单文件的压缩包. 第一步:BundleConfig public class Bund ...

  9. vnc搭建

    PS:偶以前基本不用Linux的远程图形桌面,前几天有开发的同事配置CentOS的vnc有问题,找我解决,就顺便记录总结一下,这个总结是比较完整的.下面的配置在CentOS5.x和6.x.SUSE企业 ...

  10. 分形之闵可夫斯基(Minkowski)

    与上一篇文章分形之正方形折线相似,闵可夫斯基分形也是分形出正方体,不同之处是它分出了两个正方体. 核心代码: static void FractalMinkowski(const Vector3&am ...