I\'ve found the following code at http://snipplr.com/view/2771
Which is pretty good, almost exactly what I was looking for, but if I use the values @\"1.4.5\", @
As answered in this post; Compare version numbers in Objective-C
Check out my NSString category that implements easy version checking on github; https://github.com/stijnster/NSString-compareToVersion
[@"1.2.2.4" compareToVersion:@"1.2.2.5"];
This will return a NSComparisonResult which is more accurate then using;
[@"1.2.2" compare:@"1.2.2.5" options:NSNumericSearch]
Helpers are also added;
[@"1.2.2.4" isOlderThanVersion:@"1.2.2.5"];
[@"1.2.2.4" isNewerThanVersion:@"1.2.2.5"];
[@"1.2.2.4" isEqualToVersion:@"1.2.2.5"];
[@"1.2.2.4" isEqualOrOlderThanVersion:@"1.2.2.5"];
[@"1.2.2.4" isEqualOrNewerThanVersion:@"1.2.2.5"];