If your lines are in the form of "2.0.1", etc., you can simply compare them with the appropriate parameters:
([localVersionString compare:currentVersionString options:NSNumericSearch] != NSOrderedAscending);
The above will return “ YES ” if localVersion is not older than currentVersion on the server, and “ NO ” otherwise (if I have it right).
This is a common thing when you check the local version of iOS installed on iDevice.
source share