系統資訊:
[[UIDevice currentDevice] name] // eg. "Brock's iPhone"
[[UIDevice currentDevice] model] // eg. @"iPhone", @"iPod Touch"
[[UIDevice currentDevice] localizedModel] // localized version of model
[[UIDevice currentDevice] systemName] // eg. @"iPhone OS"
[[UIDevice currentDevice] systemVersion] // eg. @"3.2"
[[UIDevice currentDevice] uniqueIdentifier] // UDID, a unique string to identify the device
範例程式:
Each of the above lines will return an
NSString
. To which you can do a string comparison like so:
NSString *model = [[UIDevice currentDevice] model];
NSLog(@"Current device model: \"%@\"", model);
其他參考資訊
http://www.drobnik.com/touch/2009/07/determining-the-hardware-model/ You will need to modify this to use the right hardware number for the iPad. Taken from the link above:
沒有留言:
張貼留言