UIDevice Properties

March 2, 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”);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading UIDevice Properties at Web Builders.

meta

%d bloggers like this: