Universal Application for IPhone/Ipod Touch 4th gen only + IPad
I'm developing a Universal Application that's only meant to be used on Retina display IPhone/IPod touch devices + IPad. How can I specify this on the plist or anywhere else in my app/binary?
UIRequiredDeviceCapabilities
doesn't do the trick for both devices, since I could specify that I require front-facing-camera
for th开发者_如何学编程e IPhone/IPod but that would exclude the IPad 1.
This can't be done. The UIRequiredDeviceCapabilities should be used to restrict capabilities that your app/game really needs or excludes, it's not meant to be used to restrict a certain set of devices just because the developer doesn't want to support them. So basically you should always design keeping in mind all devices that are currently being updated to the last OS.
I don't recommend doing this really, but you could just find out what device it is and then base loading your app on if the method isCorrectDevice
returns true:
- (BOOL) isCorrectDevice
{
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithCString:machine];
free(machine);
if ([platform isEqualToString:@"iPhone3,1"] ||
[platform isEqualToString:@"iPhone3,2"] ||
[platform isEqualToString:@"iPod4,1"] ||
[platform isEqualToString:@"iPad1,1"] ||
[platform isEqualToString:@"iPad2,1"] ||
[platform isEqualToString:@"iPad2,2"] ||
[platform isEqualToString:@"iPad2,3"])
return true;
else
return false;
}
There are a few problems doing this. One is, as soon as Apple release a new device this will be out of date and will not include the newer devices; but also, this won't stop users of other devices from downloading it. I guess you could just load a screen that says "Only available on..."? Just an idea.
精彩评论