您的位置:首页 > 其它

AFNetWorking 判断当前版本是否是最新版本

2016-04-19 14:11 316 查看
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];

}

}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: