UIDevice Properties
March 2nd, 2011 § Leave a Comment
Currently these are the most popular common UIDevice properties. It shows the device name, device identifier, device model, device system name, and device system version.
You can print these properties inside the Console for debugging.
NSLog(@”Device Name: %@”, [UIDevice currentDevice].name);
NSLog(@”UDID: %@”, [UIDevice currentDevice].uniqueIdentifier);
NSLog(@”Device Model: %@”, [UIDevice currentDevice].model);
NSLog(@”System Name: %@”, [UIDevice currentDevice].systemName);
NSLog(@”System Version: %@”, [UIDevice currentDevice].systemVersion);
NSLog(@”User Interface: %@”, [UIDevice currentDevice].userInterfaceIdiom);
If you would like to print it in a label, then you can assign an NSInteger object to the UIDevice property. Assign the UILabel text to the NSString object.
// Show Device Name
NSString *nameString = [UIDevice currentDevice].name;
nameLabel.text = nameString;
You can also print Core Foundation object in Console.
CFShow([[UIDevice currentDevice] model]);
printf(“–\n”);