仅适用于 iPhone/Ipod Touch 第四代的通用应用程序 +平板电脑

发布于 2024-11-13 08:44:56 字数 224 浏览 3 评论 0原文

我正在开发一个通用应用程序,仅适用于视网膜显示屏 iPhone/iPod 触摸设备 + iPad。我如何在 plist 或我的应用程序/二进制文件中的其他任何地方指定它?

UIRequiredDeviceCapability 对这两种设备都不起作用,因为我可以指定 iPhone/IPOd 需要 front-faceing-camera,但这会排除 iPad 1。

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 the IPhone/IPod but that would exclude the IPad 1.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无法言说的痛 2024-11-20 08:44:56

这是不可能的。 UIRequiredDeviceCapability 应该用于限制您的应用/游戏真正需要或排除的功能,它并不意味着仅仅因为开发人员不想支持某些设备而用于限制它们。因此,基本上,您在设计时应该始终牢记当前正在更新到最新操作系统的所有设备。

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.

请你别敷衍 2024-11-20 08:44:56

我并不建议这样做,但您可以找出它是什么设备,然后在方法 isCorrectDevice 返回 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;
}

这样做会遇到一些问题。一是,一旦苹果发布新设备,这就会过时,并且不包括较新的设备;而且,这不会阻止其他设备的用户下载它。我想你可以加载一个显示“仅适用于...”的屏幕?只是一个想法。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文