device-name

How do I detect whether I have iPhone 2G,3G,3GS

懵懂的女人 提交于 2019-11-26 13:08:02
问题 How to detect my current device name through iOS? 回答1: Whether you are on an iPhone or a iPod Touch: UIDevice *device = [UIDevice currentDevice]; NSString *systemName = [device systemName]; To detect the version of the OS: UIDevice *device = [UIDevice currentDevice]; NSString *systemVersion = [device systemVersion]; To detect a specific model, you would need to test for some capability that only that model has, so to detect an iPhone 3GS, check for a video capability on the camera: #define