Created
June 25, 2012 06:23
-
-
Save iiiyu/2986981 to your computer and use it in GitHub Desktop.
NSString+Version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSString+Version.m | |
// FAW-VW | |
// | |
// Created by ChenYu Xiao on 12-6-25. | |
// Copyright (c) 2012年 Sumi Interactive. All rights reserved. | |
// | |
#import "NSString+Version.h" | |
@implementation NSString (Version) | |
- (BOOL)isOlderVersionThan:(NSString *) otherVersion | |
{ | |
return ([self compare:otherVersion options:NSNumericSearch] == NSOrderedAscending); | |
} | |
- (BOOL)isNewerVersionThan:(NSString *) otherVersion | |
{ | |
return ([self compare:otherVersion options:NSNumericSearch] == NSOrderedDescending); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment