void)onCheckVersion
 {
    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
    //CFShow((__bridge CFTypeRef)(infoDic));
NSString *currentVersion = [infoDic objectForKey:@"CFBundleVersion"];
 
    NSString *URL = @"http://itunes.apple.com/lookup?id=你的应用程序的ID";
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
setURL:[NSURL URLWithString:URL]];
setHTTPMethod:@"POST"];
NSHTTPURLResponse *urlResponse = nil;
NSError *error = nil;
NSData *recervedData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
     
    NSString *results = [[NSString alloc] initWithBytes:[recervedData bytes] length:[recervedData length] encoding:NSUTF8StringEncoding];
NSDictionary *dic = [results JSONValue];
NSArray *infoArray = [dic objectForKey:@"results"];
if ([infoArray count]) {
NSDictionary *releaseInfo = [infoArray objectAtIndex:0];
NSString *lastVersion = [releaseInfo objectForKey:@"version"];
         
if (![lastVersion isEqualToString:currentVersion]) {
            //trackViewURL = [releaseInfo objectForKey:@"trackVireUrl"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"更新" message:@"有新的版本更新,是否前往更新?" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles:@"更新", nil];
tag = 10000;
show];
         }
else
         {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"更新" message:@"此版本为最新版本"delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
tag = 10001;
show];
         }
     }
 }
void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
 {
if (alertView.tag==10000) {
if (buttonIndex==1) {
            NSURL *url = [NSURL URLWithString:@"https://itunes.apple.com"];
            [[UIApplication sharedApplication]openURL:url];
         }
     }
 }