1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-20 01:14:20 +00:00

SystemStats: Use new dictionaryWithContentsOfURL signature

This commit is contained in:
reuk 2020-10-29 12:48:14 +00:00
parent 4fd3dfb51b
commit 35277443e4

View file

@ -121,10 +121,21 @@ static String getOSXVersion()
{
JUCE_AUTORELEASEPOOL
{
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:
nsStringLiteral ("/System/Library/CoreServices/SystemVersion.plist")];
const String systemVersionPlist ("/System/Library/CoreServices/SystemVersion.plist");
return nsStringToJuce ([dict objectForKey: nsStringLiteral ("ProductVersion")]);
#if (defined (MAC_OS_X_VERSION_10_13) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_13)
NSError* error = nullptr;
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL: createNSURLFromFile (systemVersionPlist)
error: &error];
#else
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile: juceStringToNS (systemVersionPlist)];
#endif
if (dict != nullptr)
return nsStringToJuce (dict[nsStringLiteral ("ProductVersion")]);
jassertfalse;
return {};
}
}
#endif