zoukankan      html  css  js  c++  java
  • 判断APP是否是最新版本 和 获取 APP 版本号

    <写在一个方法中>

    - (void)VersionUpdate{

        

        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];

        CFShow(infoDictionary);

        NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];

        AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

        [manager GET:@"https://itunes.apple.com/cn/lookup?id=868722244" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {

            

            NSDictionary *dic = (NSDictionary *)responseObject;

            NSArray *arr = [dic objectForKey:@"results"];

            NSString *app_NewVersion = [[arr objectAtIndex:0] objectForKey:@"version"];

        //判断 然后 弹出    AlertView

            if (![app_Version isEqualToString:app_NewVersion]) {

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"当前版本不是最新版本,是否更新" delegate:self cancelButtonTitle:@"下次更新" otherButtonTitles:@"更新", nil];

                [alert show];

                [alert release];

            }

            

        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

            

        }];

        

    }

  • 相关阅读:
    PhpStorm一次性折叠所有函数或者方法
    安装IntelliJ IDEA热部署tomcat插件JreBel
    mysql-master-ha
    mysql sys table
    Innodb 表修复(转)
    MySQL Binlog 【ROW】和【STATEMENT】选择(转)
    Innodb 存储引擎(转)
    MySQL 利用SQL线程对Binlog操作(转)
    针对跑MySQL的Linux优化【转】
    MySQL explain key_len 大小的计算
  • 原文地址:https://www.cnblogs.com/ysh-LOVE-hmx-5201314/p/4331029.html
Copyright © 2011-2022 走看看