是否可以让应用程序仅在黄金iPhone上运行?

时间:2013-10-02 22:52:18

标签: iphone

是否可以使用Xcode配置或其他方法仅定位金色iPhone?

1 个答案:

答案 0 :(得分:0)

无法通过公共API以编程方式检测iOS设备颜色。 不过,你可以使用私人的。 根据@Ortwin Gentz的回答here

UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString(@"deviceInfoForKey:");
if (![device respondsToSelector:selector]) {
    selector = NSSelectorFromString(@"_deviceInfoForKey:");
}
if ([device respondsToSelector:selector]) {
    NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);
}