zoukankan      html  css  js  c++  java
  • AFNetWorking 判断当前版本是否是最新版本

      NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",@"***"];

        [self reqeautDataUrl:url parma:nil block:^(NSDictionary *dataDic, NSError *error) {

            [self hideHud];

            if(error){

                [self showAlertView:@"版本获取失败"];

                return ;

            }

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

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

            if([[dataDic objectForKey:@"version"] isEqualToString:app_Version]){

                UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"提示" delegate:nil cancelButtonTitle:@"确定" destructiveButtonTitle:@"已经是最新版本" otherButtonTitles:nil, nil];

                [actionSheet showInView:self.view];

            }else {

                UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"提示" delegate:nil cancelButtonTitle:@"确定" destructiveButtonTitle:@"请更新最新的版本" otherButtonTitles:nil, nil];

                [actionSheet showInView:self.view];

            }

        }];

  • 相关阅读:
    Java三大特殊类
    静态顺序表and动态顺序表(一)_插入操作
    模拟实现memcpy、memmove函数
    模拟实现strcpy函数
    模拟实现Strlen函数
    数组相关知识总结(一)
    C语言学习总结(二)__操作符
    受控组件 & 非受控组件
    SyntheticEvent
    ReactDOM & DOM Elements
  • 原文地址:https://www.cnblogs.com/hualuoshuijia/p/5408001.html
Copyright © 2011-2022 走看看