I read Apress - Beginning iPad Development for iPhone Developer Mastering the iPad SDK , and in one chapter I read about checking the device and writing the author:
βAlthough you may just need to check the type of user device or version of the operating system, Apple is constantly releasing new devices and versions of iOS, itβs not. The best approach is to check for exclusive iPad classes using NSClassFromString. If you pass the class name iPad for example, UISplitViewController in NSClassString and the actual object is returnet, you will find out that the user device is an iPad .. "
I do not understand why just check the type of device, for example:
NSString *device = [[UIDevice currentDevice] model]; if ([device rangeOfString:@"iPad"].location != NSNotFound ) { isIPad = true; } else isIPad = false;
Worse than checking ipad classes?
objective-c iphone device ipad
Tomasz szulc
source share