iOS 应用版本号比较
2016-08-25 本文已影响1374人
Michael_NO1
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
NSString *vison = infoDict[@"CFBundleVersion"];
// NSString *vison = @"1.2.5";
NSString *vison2 = @"1.13.4";
if ([vison compare:vison2 options:NSNumericSearch] == NSOrderedDescending)
{
NSLog(@"%@ is bigger",vison);
} else {
NSLog(@"%@ is bigger",vison2);
}