我有一个 iphone 应用程序需要为 iPhone 3.1.3 和 iPad 3.2 工作。这是我想在 iPad 上工作的 iPhone 应用程序。
主要区别在于 MPMoviePlayerController 在 3.2 中引入/弃用了很多东西。
由于 iPhone 操作系统只升级到 3.1.3 而 iPad 是 3.2,所以我需要分离我的代码,以便它只编译相应操作系统所需的代码。
我不能使用 [[UIDevice currentDevice] model] 因为我最终在 3.1.3 代码上收到了已弃用的警告。此外,UIUserInterfaceIdiomPad 是 3.2 中的新功能,因此它不适用于 3.1.3...
所以,我决定使用它,它只编译特定操作系统所需的内容:
#if __IPHONE _3_2
//do 3.2 iPad stuff
#else
//do 3.1.3 iPhone/iPod Touch stuff
#endif
我的问题是......这些有什么区别?
#ifdef __IPHONE_3_2
和
#if __IPHONE_3_2
谢谢