fix compilation warnings under xcode 8

This commit is contained in:
Antonin Hildebrand committed 2016-06-16 19:00:35 +02:00
1 parent 08f55bce01
commit a819fbbfa9
3 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -20,7 +20,8 @@
{
NSOperatingSystemVersion version = { 0, 0, 0 };
NSURL *coreServices = [[NSFileManager defaultManager] URLForDirectory:NSCoreServiceDirectory inDomain:NSSystemDomainMask appropriateForURL:nil create:NO error:nil];
NSArray *components = [[NSDictionary dictionaryWithContentsOfURL:[coreServices URLByAppendingPathComponent:@"SystemVersion.plist"]][@"ProductVersion"] componentsSeparatedByString:@"."];
NSURL* systemVersionPlistUrl = [coreServices URLByAppendingPathComponent:@"SystemVersion.plist"];
NSArray *components = [[NSDictionary dictionaryWithContentsOfURL:systemVersionPlistUrl][@"ProductVersion"] componentsSeparatedByString:@"."];
version.majorVersion = components.count > 0 ? [components[0] integerValue] : 0;
version.minorVersion = components.count > 1 ? [components[1] integerValue] : 0;
version.patchVersion = components.count > 2 ? [components[2] integerValue] : 0;