新版本中已经不支持以前的方法了,所以需要更新一下代码:
[window addSubview:nav.view];
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{ // warning: addSubView doesn't work on iOS6
[window addSubview: nav.view];
}
else
{ // use this method on ios6
[window setRootViewController:nav];
}
#if 0
#else //add this part
#endif
然后就OK了。
补充,关于新版本中屏幕旋转可以参考这篇文章: