//获取版本信息
- (void) getVersion
{
versionVC = [[kbCompareVersion alloc] init];
[versionVC getVersion:943406352];
}
//进行版本比较
-(void) compareVersion
{
[versionVC compareVersion];
switch (versionVC.updata) {
case 0: {
}
break;
case 1:{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:versionVC.info delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"更新", nil];
alert.tag = 1111;
[alert show];
}
break;
default:
break;
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
{
if (alertView.tag == 1111) {
//版本更新提示
if (buttonIndex == 0) {
}
else if (buttonIndex == 1 ){
NSString *appid = @"943406352";
NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%@",appid];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
}