如何确定iphone/ipad/ipod/appletv是否较旧、较新或等同于同一系列的其他设备?
如何比较不同的平台 例如:如何确定iphone/ipad/ipod/appletv是否较旧、较新或等同于同一系列的其他设备?,iphone,ios,ipad,ipod,uidevice,Iphone,Ios,Ipad,Ipod,Uidevice,如何比较不同的平台 例如: 我想知道当前设备是否比iPhone 4S旧。如果需要进行比较,可以使用 然后,您可以轻松地比较相同类型的平台 UIDeviceComparisonResult result = [[UIDevice currentDevice] compareCurrentPlatformWithOtherPlatform:@"iPhone4,1"]; BOOL isOlderThanIPhone4S = result == UIDeviceComparisonResultO
我想知道当前设备是否比iPhone 4S旧。如果需要进行比较,可以使用
UIDeviceComparisonResult result = [[UIDevice currentDevice] compareCurrentPlatformWithOtherPlatform:@"iPhone4,1"];
BOOL isOlderThanIPhone4S = result == UIDeviceComparisonResultOtherNewer;
return isOlderThanIPhone4S;
所有平台的名称都可以在UIDevice Hardware中找到。m将这些方法添加到某个类(例如YourClass): 然后,如果在iPhone上,想要测试版本:
float iPhoneVersion = [[YourClass getVersionForDevice:@"iPhone"] floatValue];
对iPad也有类似的要求。。。iPod…如果你否决我的问题,请留下评论。我需要知道为什么这是一个糟糕的问题,以改善它。有趣!看起来很有希望
float iPhoneVersion = [[YourClass getVersionForDevice:@"iPhone"] floatValue];