Available Properties in UIDevice
- uniqueIdentifier – identifier guaranteed to be unique for every device
- name – arbitrary name found in General > About setting on device
- systemName – name of the OS running on the device
- systemVersion – current version of the OS
- model- model, such as ”iPhone” or ”iPod touch”
- localizedModel – same as above using a localized string
?
?
@property(nonatomic,readonly,retain) NSString *name; // e.g. "My iPhone"@property(nonatomic,readonly,retain) NSString *model; // e.g. @"iPhone", @"iPod Touch"@property(nonatomic,readonly,retain) NSString *localizedModel; // localized version of model@property(nonatomic,readonly,retain) NSString *systemName; // e.g. @"iPhone OS"@property(nonatomic,readonly,retain) NSString *systemVersion; // e.g. @"2.0"@property(nonatomic,readonly) UIDeviceOrientation orientation; // return current device orientation@property(nonatomic,readonly,retain) NSString *uniqueIdentifier; NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);NSLog(@"name: %@", [[UIDevice currentDevice] name]);NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);NSLog(@"model: %@", [[UIDevice currentDevice] model]);NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
??
--------------------------------------------------------------------------------------
iphone simulator:
2010-10-15 09:20:43.661 SmartRoadShow[1404:207] uniqueIdentifier: 759A9CA7-F880-5BB3-B225-9CE89ABF1B0D
2010-10-15 09:20:43.662 SmartRoadShow[1404:207] name: iPhone Simulator
2010-10-15 09:20:43.662 SmartRoadShow[1404:207] systemName: iPhone OS
2010-10-15 09:20:43.663 SmartRoadShow[1404:207] systemVersion: 4.0.2
2010-10-15 09:20:43.663 SmartRoadShow[1404:207] model: iPhone Simulator
2010-10-15 09:20:43.664 SmartRoadShow[1404:207] localizedModel: iPhone Simulator
?
?
--------------------------------------------------------------------------------------
ipod touch:
2010-10-15 09:20:02.367 SmartRoadShow[8180:207] uniqueIdentifier: c0f52b74f9609b70e9289e95476e165df2365677
2010-10-15 09:20:02.383 SmartRoadShow[8180:207] name: iBokanWisdom的 iPod
2010-10-15 09:20:02.397 SmartRoadShow[8180:207] systemName: iPhone OS
2010-10-15 09:20:02.412 SmartRoadShow[8180:207] systemVersion: 3.1.2
2010-10-15 09:20:02.427 SmartRoadShow[8180:207] model: iPod touch
2010-10-15 09:20:02.442 SmartRoadShow[8180:207] localizedModel: iPod touch