Skip to content

Commit 57fe1ab

Browse files
Merge pull request #203 from Automattic/dayone-fix-mac-os-version
Make Mac OS version parsable
2 parents f0a0fdd + 839115d commit 57fe1ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Model/ObjC/Common/TracksDeviceInformation.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ - (NSString *)version
109109
#if TARGET_OS_IPHONE
110110
return [[UIDevice currentDevice] systemVersion];
111111
#else // Mac
112-
return [[NSProcessInfo processInfo] operatingSystemVersionString];
112+
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
113+
NSInteger major = version.majorVersion;
114+
NSInteger minor = version.minorVersion;
115+
NSInteger patch = version.patchVersion;
116+
return [NSString stringWithFormat: @"%ld.%ld.%ld", (long)major, (long)minor, (long)patch];
113117
#endif
114118
}
115119

0 commit comments

Comments
 (0)