iPhone / iPod模拟器和设备之间的差异 [英] Differences between iPhone/iPod Simulator and Devices

查看:306
本文介绍了iPhone / iPod模拟器和设备之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我开始使用iPhone / iPod开发以来,我发现模拟器与真实设备的反应方式之间存在一些差异。也许我会遇到一些其他的差异,我也必须弄清楚,也许其他人在这里没有遇到这些问题(YET)并且可以从知识中获利,也许你知道一些问题/差异你本来应该很高兴早些时候知道你花了几个小时或几天才弄清楚到底发生了什么。

Since I started iPhone/iPod Development I have come across some differences between how the simulator and how real device react. Maybe I will come across some other differences I will have to figure out as well, maybe other people haven't met these problems here (YET) and can profit from the knowledge, and maybe you know some problems/differences that you would have been happy to know about earlier before you spent several hours or days figuring out what the heck is going on.

所以这就是我遇到的情况。

So here is what I came across.


  1. 模拟器不区分大小写,设备区分大小写。

  1. Simulator is not case sensitive, Devices are case sensitive.


  • 这意味着default.png或Icon.png将在模拟器中运行,但不能在必须命名为Default.png和icon.png的设备上运行(如果它仍然无效,则读取这个答案

  • This means a default.png or Icon.png will work in simulator, but not on a device where they must be named Default.png and icon.png (if it's still not working read this answer)

模拟器有不同的编解码器来播放音频和视频

Simulator has different codecs to play audio and video


  • 如果你用fe MPMoviePlayerController您可以在模拟器上播放某些视频,而在设备上它将无法工作
    (使用Handbrake-> presets-> iPhone& iPod Touch为模拟器和设备创建可播放的视频)。

  • 如果您使用AudioServicesPlaySystemSound(& soundID)播放音频,您可能会在模拟器上播放声音但不是设备。 (使用Audacity打开声音文件,导出为wav并运行afconvert -f caff -d LEI16 @ 44100 -c 1 audacity.wav output.caf in terminal)

此外,第二次运行时出现这种闪烁问题,可以通过

playerViewCtrl.initialPlaybackTime = -1.0来解决;

结尾在每次开始之前或之前。

Also there is this flickering on second run problem which can be resolved with an
playerViewCtrl.initialPlaybackTime = -1.0;
either on the end of playing or before each beginning.

模拟器大多快得多,因为它不模拟硬件但使用Mac资源,因此fe sio2应用程序(OpenGL,Op​​enAL等框架)在模拟器上运行得更好,使用更多资源的所有内容在模拟器中运行的效果明显优于在设备上运行。

Simulator is mostly much faster cause it doesn't simulate the hardware but uses Mac resources, therefore f.e. sio2 Apps (OpenGL,OpenAL,etc. framework) run much better on simulator, well everything that uses more resources will run visibly better in simulator than on device.

我希望我们可以为此添加更多。

I hope we can add some more to this.

推荐答案

只是为了澄清你的第一个point:

Just to clarify your first point:


模拟器不区分大小写,设备区分大小写

Simulator is not case sensitive, Devices are case sensitive

在这种意义上区分大小写或不区分大小并不是模拟器的特征。这是底层文件系统的一个特征。设备上的文件系统是区分大小写的HFS +,而Mac上的文件系统可能不区分大小写(默认情况下)。如果应用程序在区分大小写的HFS +分区上运行,那么即使它在模拟器中运行,它也会在从磁盘加载文件时变得区分大小写。

Being case-sensitive or not in that sense is not a characteristic of simulator. It's a characteristic of the underlying filesystem. The filesystem on device is case sensitive HFS+ while the file system on the Mac is likely to be case insensitive (by default). If the application runs on a case sensitive HFS+ partition, it'll become case sensitive when it comes to loading files from disk even when it runs in the simulator.

这篇关于iPhone / iPod模拟器和设备之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆