mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge pull request #81 from jpetrie/propertylist-serialization-warnings
Fix NSPropertyListSerialization deprecation warnings.
This commit is contained in:
+3
-1
@@ -40,7 +40,9 @@
|
||||
#ifndef MAC_OS_X_VERSION_10_10_3
|
||||
# define MAC_OS_X_VERSION_10_10_3 101003
|
||||
#endif
|
||||
|
||||
#ifndef MAC_OS_X_VERSION_10_11
|
||||
# define MAC_OS_X_VERSION_10_11 101100
|
||||
#endif
|
||||
|
||||
//
|
||||
// This is the protocol MMBackend implements.
|
||||
|
||||
@@ -304,19 +304,32 @@ debugStringForMessageQueue(NSArray *queue)
|
||||
|
||||
+ (id)dictionaryWithData:(NSData *)data
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
|
||||
id plist = [NSPropertyListSerialization
|
||||
propertyListWithData:data
|
||||
options:NSPropertyListImmutable
|
||||
format:NULL
|
||||
error:NULL];
|
||||
#else
|
||||
id plist = [NSPropertyListSerialization
|
||||
propertyListFromData:data
|
||||
mutabilityOption:NSPropertyListImmutable
|
||||
format:NULL
|
||||
errorDescription:NULL];
|
||||
#endif
|
||||
|
||||
return [plist isKindOfClass:[NSDictionary class]] ? plist : nil;
|
||||
}
|
||||
|
||||
- (NSData *)dictionaryAsData
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
|
||||
return [NSPropertyListSerialization dataWithPropertyList:self
|
||||
format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL];
|
||||
#else
|
||||
return [NSPropertyListSerialization dataFromPropertyList:self
|
||||
format:NSPropertyListBinaryFormat_v1_0 errorDescription:NULL];
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -328,11 +341,19 @@ debugStringForMessageQueue(NSArray *queue)
|
||||
|
||||
+ (id)dictionaryWithData:(NSData *)data
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
|
||||
id plist = [NSPropertyListSerialization
|
||||
propertyListWithData:data
|
||||
options:NSPropertyListMutableContainers
|
||||
format:NULL
|
||||
error:NULL];
|
||||
#else
|
||||
id plist = [NSPropertyListSerialization
|
||||
propertyListFromData:data
|
||||
mutabilityOption:NSPropertyListMutableContainers
|
||||
format:NULL
|
||||
errorDescription:NULL];
|
||||
#endif
|
||||
|
||||
return [plist isKindOfClass:[NSMutableDictionary class]] ? plist : nil;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user