So, it looks like the method you want to use is to use the category created by Erica Sadun located at https://github.com/erica/uidevice-extension/
Before moving on to use, I will talk a bit about categories. Apple provides category documentation here http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/chapters/occategories.html
You can add methods to the class by declaring them in the interface file under the category name and defining them in the implementation file under the same name. The category name indicates that the methods are complementary to the class declared elsewhere, and not the new class. You cannot, however, use a category to add additional instance variables to a class.
Download the project from github and add these two files to your project:
UIDevice-Hardware.h UIDevice-Hardware.m
The methods you will use will be as follows:
- (NSString *) platform; - (NSString *) hwmodel; - (NSUInteger) platformType; - (NSString *) platformString;
So, you will want to import UIDevice-Hardware.h into the file in which you want to use this method. You should use the method to return the NSString value and assign the value to the label so that you do something similar to
mylabel.text = [[UIDevice currentDevice] platformString]
Here is another link that has a good introduction to the categories: http://mobile.tutsplus.com/tutorials/iphone/objective-c-categories/
EDIT: SCREEN SAMPLES USING THE DEVICE SIMULATOR:
Note: there is also #import "UIDevice-Hardware.h" above my @interface line.
source share