我试图确定我的代码是在iPhone还是iPhone3G上运行.我的第一次尝试是在UIKit中使用UIDevice类,但iPhone和iPhone3G都返回相同的响应:
NSLog([[UIDevice currentDevice] name]); // Name of the phone as named by user
NSLog([[UIDevice currentDevice] uniqueIdentifier]); // A GUID like string
NSLog([[UIDevice currentDevice] systemName]); // "iPhone OS"
NSLog([[UIDevice currentDevice] systemVersion]); // "2.2.1"
NSLog([[UIDevice currentDevice] model]); // "iPhone" on both devices
NSLog([[UIDevice currentDevice] localizedModel]); // "iPhone" on both devices
Run Code Online (Sandbox Code Playgroud)
这些是UIDevice允许您查询的唯一参数.
我在Foundation Framework中看了一下,但还没有找到合适的电话.
我敢肯定有一些我可以查询的硬件(例如位置服务中的东西),但这似乎是一个黑客.有谁知道确定这个的简单方法?
我们正在构建一个需要iPad 2或iPhone 4S的RAM,GPU和内核的应用程序.有没有办法配置应用程序,以便它在应用程序商店中不可用于较小硬件的用户?
我知道我只能制造armv7,这就消除了真正的旧东西.看起来我可能需要一个静态相机(即使我们不使用它),以消除iPad 1(虽然这感觉就像一个黑客).但这并不能让它脱离iPhone 4或Touch 4.
有什么建议?
我一直在努力解决这个问题,但有没有办法通过info.plist或其他方式使应用程序与ONLY iPhone 4S(或新的iPad + iPhone 4S)兼容,以便其他iOS设备型号的用户无法查看和下载应用在他们的设备上?
有没有办法获得iPhone相机的分辨率?显然3G有1200x1600,3GS有1500x2000,但我如何从我的代码中获取这些值(没有拍照).我需要他们对相机预览做一些仿射变换.
我可以检测它是3G或3GS来硬编码这些值,但它只是最后的手段.
iphone ×4
ios ×3
app-store ×1
camera ×1
detect ×1
info.plist ×1
ios5 ×1
ipad ×1
iphone-3gs ×1
resolution ×1
xcode ×1