Skip to content

Instantly share code, notes, and snippets.

@cmckni3
Last active August 29, 2015 14:06
Show Gist options
  • Save cmckni3/8147977a2f02ae3f3bef to your computer and use it in GitHub Desktop.
Save cmckni3/8147977a2f02ae3f3bef to your computer and use it in GitHub Desktop.
Detect Mac OS X Version
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