iOS检测App是否需要升级

-(void)alertView:(UIAlertView *)alertView
    clickedButtonAtIndex:(NSInteger)buttonIndex
    {
      if(alertView.tag ==
    kVersionNeedUpdateAlertTag) {
        //软件需要更新提醒
        if(buttonIndex == 1) {
          NSURL *url= [NSURL
    URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/cn/app/wan-zhuan-quan-cheng/id%i?mt=8",iFeverAPPID]];
          [[UIApplication
    sharedApplication]openURL:url];
          /*
           // 打开iTunes 方法二:此方法总是提示“无法连接到itunes”,不推荐使用
           NSString *iTunesLink= @"itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=%i&mt=8";
           NSURL *url= [NSURL
    URLWithString:[NSString stringWithFormat:@"itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=%i&mt=8",iFeverAPPID]];
           [[UIApplication
    sharedApplication] openURL:url];
           */
        }
      }
    }

你可能感兴趣的:(iOS检测App是否需要升级)