Last active
August 29, 2015 14:06
-
-
Save cmckni3/8147977a2f02ae3f3bef to your computer and use it in GitHub Desktop.
Detect Mac OS X 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
NSDictionary *systemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; | |
NSString *reqSysVer = @"10.7"; | |
NSString *currSysVer; | |
currSysVer = [systemVersionDictionary objectForKey:@"ProductVersion"]; | |
// For testing | |
// currSysVer = @"10.10"; | |
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) | |
NSLog(@"Version requirement met"); | |
else | |
NSLog(@"Version requirement not met"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment