Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在与iOS 8兼容的iTunes上上传新版本时使用哪个xcode?_Xcode_Ios8_App Store Connect - Fatal编程技术网

在与iOS 8兼容的iTunes上上传新版本时使用哪个xcode?

在与iOS 8兼容的iTunes上上传新版本时使用哪个xcode?,xcode,ios8,app-store-connect,Xcode,Ios8,App Store Connect,我必须上传与iOS 8兼容的应用程序的更新版本。 当我从Xcode 6.1(非测试版)上传应用程序时,我遇到以下错误 提交到应用商店的应用和应用更新必须使用Xcode 5.1.1或更高版本以及iOS 7或更高版本SDK构建 当我上传带有XCode 5.1.1的应用程序时,我无法使用以下代码进行推送通知 UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotif

我必须上传与iOS 8兼容的应用程序的更新版本。 当我从Xcode 6.1(非测试版)上传应用程序时,我遇到以下错误

提交到应用商店的应用和应用更新必须使用Xcode 5.1.1或更高版本以及iOS 7或更高版本SDK构建

当我上传带有XCode 5.1.1的应用程序时,我无法使用以下代码进行推送通知

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];

您的应用程序需要使用iOS7编译,并使用xcode 5构建,因此您不能使用仅在iOS8中可用的新API

您需要使用以下代码:

    // changes of API in iOS 8.0
- (void) registerForPushNotification
{
    NSLog(@"registerForPushNotification");
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
    {

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 //__IPHONE_8_0 is not defined in old xcode (==0). The use 80000

        NSLog(@"registerForPushNotification: For iOS >= 8.0");

        [[UIApplication sharedApplication] registerUserNotificationSettings:
            [UIUserNotificationSettings settingsForTypes:
                (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
                                              categories:nil]];
        [[UIApplication sharedApplication] registerForRemoteNotifications];
#endif
    } else {
        NSLog(@"registerForPushNotification: For iOS < 8.0");
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
         (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
    }
}
//iOS 8.0中API的更改
-(无效)注册登记通知
{
NSLog(@“registerForPushNotification”);
如果([[[UIDevice currentDevice]systemVersion]floatValue]>=8.0)
{
#如果在旧xcode(=0)中未定义{uuuu IPHONE\u OS\u VERSION\u MAX\u ALLOWED>=\uuu IPHONE\u 8\u 0/\uu IPHONE\u 8\u 0,则使用80000
NSLog(@“registerForPushNotification:For iOS>=8.0”);
[[UIApplication sharedApplication]注册表通知设置:
[UIUserNotificationSettings设置类型:
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
类别:无]];;
[[UIApplication sharedApplication]注册表项的删除];
#恩迪夫
}否则{
NSLog(@“registerForPushNotification:对于iOS<8.0”);
[[UIApplication sharedApplication]RegisterForRemotionTifications类型:
(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
}
}

这里有更多信息:

据我所知,您必须在xcode 6中打开并运行该项目一次,以确保对iPhone 6/6+和iOS 8的支持。然后通过xcode上传

但是我得到了“registerUserNotificationSettings”的编译时错误。如何创建生成?iOS7中没有“registerUserNotificationSettings”。替换此代码的代码:[[UIApplication sharedApplication]RegisterForremoteNotificationTypeAlert:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];它们可以很好地工作,因为当您使用xcode 5时,应用程序将使用iOS7编译。不会,因为iOS7 SDK不知道“registerUserNotificationSettings”。我试过了,我认为你不理解我。替换此代码:UIUserNotificationSettings*settings=[UIUserNotificationSettings设置类型:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)类别:nil];[[UIApplication sharedApplication]注册表通知设置:设置];[[UIApplication sharedApplication]注册表项的删除];为此:[[UIApplication sharedApplication]RegisterForRemotionTificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];在我的问题“当我从Xcode 6.1(非测试版)上传应用程序时,我遇到了以下错误”“哦,显然误解了你的问题,我的错。对不起,那我就不知道答案了。祝你好运!没问题,谢谢你的尝试。我已经用XCode 6.0.1上传了构建。