问题描述
我有一个通用的应用程序,可在iPad,iPhone 4G,3GS和iPad上运行并完美运行3G,但是当在iPod Touch 4G上运行时,它将无法正常运行。
I have a universal app built that runs and works perfectly on an iPad, iPhone 4G, 3GS & 3G, but when run on an iPod Touch 4G it won't run properly.
我没有iPod Touch进行测试,但我被告知它安装在设备上的beta测试仪很好,但是在运行时它会显示推出时被压缩到屏幕上的iPad版本的Default.png,然后从那里变黑。当应用程序强制退出(使用应用程序切换器)并重新启动时,它会再次执行相同操作。
I don't have a iPod Touch to test, but I have been told by a beta tester that it installs on the device fine, but when run it shows the Default.png from the iPad version of the app squashed into the screen when launched, then just goes black from there. When the app is force quit (using the app switcher) and re-launched it does the same thing again.
我已经仔细检查过目标设备系列是iPhone / iPad做了一个干净的构建等但仍然没有骰子。
I have double checked that the Targeted Device Family is iPhone/iPad and done a clean build etc. but still no dice.
推荐答案
所以经过一些试验和错误我找出了问题所在是(实际上是两个独立但相关的问题):
So after some trial and error I worked out what the problem was (actually two separate but related problems):
在我的 info.plist
我使用两个键分配不同的MainWindow文件:
In my info.plist
I was using two keys to assign the different MainWindow files:
主nib文件基本名称(iPad)
和
主nib文件基本名称(iPhone)
我错误地认为第二把钥匙也适用于iPod Touch,因为没有主nib文件基本名称(iPodTouch)
键。事实证明这是错误的,iPod Touch实际上会查找主nib文件基本名称
键。所以我现在设置如下:
I mistakenly thought the second key would apply to the iPod Touch also as there is no Main nib file base name (iPodTouch)
key. Turns out this is wrong and the iPod Touch actually looks for the Main nib file base name
key. So now I have it setup like this:
..它在3.1.3& 4.2。 (注意,如果设备找不到要使用的MainWindow,则不会调用 application:didFinishLaunchingWithOptions
。这就是我解决问题的方法。)
..and it's working fine in 3.1.3 & 4.2. (Note that application:didFinishLaunchingWithOptions
is not called if the device can't find a MainWindow to use, that's how I worked out the problem).
我怀疑同样适用于启动图像(iPad)
,启动图像(iPhone)
和启动图像
键,这可以解释为什么iPod Touch正在使用iPad发布图像,但还没有尝试过。
I suspect the same will apply to the Launch image (iPad)
, Launch image (iPhone)
and Launch image
keys, which would explain why the iPod Touch is using the iPad launch image but haven't been able to try it yet.
这篇关于iPod Touch 4G认为它是iPad的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!