Skip to content

Commit

Permalink
Updating deprecated API for properyListFromData
Browse files Browse the repository at this point in the history
  • Loading branch information
Roderic Campbell committed Aug 13, 2014
1 parent 541cc73 commit 9c9693f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions EGOCache.m
Expand Up @@ -337,11 +337,10 @@ - (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NS

- (NSData*)plistForKey:(NSString*)key; {
NSData* plistData = [self dataForKey:key];

return [NSPropertyListSerialization propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:nil
errorDescription:nil];
return [NSPropertyListSerialization propertyListWithData:plistData
options:NSPropertyListImmutable
format:nil
error:nil];
}

- (void)setPlist:(id)plistObject forKey:(NSString*)key; {
Expand All @@ -350,10 +349,11 @@ - (void)setPlist:(id)plistObject forKey:(NSString*)key; {

- (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; {
// Binary plists are used over XML for better performance
NSData* plistData = [NSPropertyListSerialization dataFromPropertyList:plistObject
format:NSPropertyListBinaryFormat_v1_0
errorDescription:NULL];

NSData* plistData = [NSPropertyListSerialization dataWithPropertyList:plistObject
format:NSPropertyListBinaryFormat_v1_0
options:0
error:nil];

[self setData:plistData forKey:key withTimeoutInterval:timeoutInterval];
}

Expand Down

0 comments on commit 9c9693f

Please sign in to comment.