@@ -304,19 +304,32 @@ @implementation NSDictionary (MMExtras)
304304
305305+ (id )dictionaryWithData : (NSData *)data
306306{
307+ #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
308+ id plist = [NSPropertyListSerialization
309+ propertyListWithData: data
310+ options: NSPropertyListImmutable
311+ format: NULL
312+ error: NULL ];
313+ #else
307314 id plist = [NSPropertyListSerialization
308315 propertyListFromData: data
309316 mutabilityOption: NSPropertyListImmutable
310317 format: NULL
311318 errorDescription: NULL ];
319+ #endif
312320
313321 return [plist isKindOfClass: [NSDictionary class ]] ? plist : nil ;
314322}
315323
316324- (NSData *)dictionaryAsData
317325{
326+ #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
327+ return [NSPropertyListSerialization dataWithPropertyList: self
328+ format: NSPropertyListBinaryFormat_v1_0 options: 0 error: NULL ];
329+ #else
318330 return [NSPropertyListSerialization dataFromPropertyList: self
319331 format: NSPropertyListBinaryFormat_v1_0 errorDescription: NULL ];
332+ #endif
320333}
321334
322335@end
@@ -328,11 +341,19 @@ @implementation NSMutableDictionary (MMExtras)
328341
329342+ (id )dictionaryWithData : (NSData *)data
330343{
344+ #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_10
345+ id plist = [NSPropertyListSerialization
346+ propertyListWithData: data
347+ options: NSPropertyListMutableContainers
348+ format: NULL
349+ error: NULL ];
350+ #else
331351 id plist = [NSPropertyListSerialization
332352 propertyListFromData: data
333353 mutabilityOption: NSPropertyListMutableContainers
334354 format: NULL
335355 errorDescription: NULL ];
356+ #endif
336357
337358 return [plist isKindOfClass: [NSMutableDictionary class ]] ? plist : nil ;
338359}
0 commit comments