最简单和最短的方法是检查相机,如iPad 2检测中所述:
BOOL isIPad2 = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && [UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]);
或者更简单:
BOOL isiPad2 = [[self platform] isEqualToString:@"iPad2,1"];
请记住,字符串可以是iPad2,2
和iPad2,3
也.
最简单和最短的方法是检查相机,如iPad 2检测中所述:
BOOL isIPad2 = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && [UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]);
或者更简单:
BOOL isiPad2 = [[self platform] isEqualToString:@"iPad2,1"];
请记住,字符串可以是iPad2,2
和iPad2,3
也.