OC版版本检测对比大小最简代码,抄自iVersion

@implementation NSString(iVersion)

  • (NSComparisonResult)compareVersion:(NSString *)version
    {
    return [self compare:version options:NSNumericSearch];
    }

  • (NSComparisonResult)compareVersionDescending:(NSString *)version
    {
    return (NSComparisonResult)(0 - [self compareVersion:version]);
    }

@end

你可能感兴趣的:(OC版版本检测对比大小最简代码,抄自iVersion)