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];
}
}];