iOS 版本号判断

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

    NSString*vison = infoDict[@"CFBundleVersion"];

    //    NSString *vison = @"1.2.5";

    NSString*vison2 =@"1.1.4";

    if ([vison compare:vison2 options:NSNumericSearch] == NSOrderedDescending){

        NSLog(@"%@ is bigger",vison);


    }else{

        NSLog(@"%@ is bigger",vison2);


    }

你可能感兴趣的:(iOS 版本号判断)