我正在尝试将我的 iPhone 应用程序从 3.0 升级到 4.0
某些 API 在 4.0 中已弃用,如果我使用新的 API,它可能无法在 3.0 上运行,对吧?因此我需要有一个旧的 API 和新的 API
对于所有专业开发人员来说,为 3.0 和 4.0 编写代码的最佳方式是什么?
我知道我可以从 UIDevice 检查模型和系统版本。
我是否需要先检查哪个版本并检查哪个设备?
if systemVersion == 3.0 {
//old api code here
}
if systemVersion == 4.0 {
if device == iphone 3G
//new api code here for 3G
if device == iphone 3GS
//new api code here for 3GS
if device == iphone 4
//new api code here for 4
}