Last active
June 11, 2018 10:52
-
-
Save sdpjswl/10f71a42506e02b91fc5 to your computer and use it in GitHub Desktop.
Get a deep Mutable copy of NSArray and NSDictionary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSMutableDictionary *)deepMutableCopyOfDictionary:(NSDictionary *)dictionary | |
{ | |
return (__bridge_transfer NSMutableDictionary *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (__bridge CFDictionaryRef)dictionary, kCFPropertyListMutableContainers); | |
} | |
+ (NSMutableArray *)deepMutableCopyOfArray:(NSArray *)array | |
{ | |
return (__bridge_transfer NSMutableArray *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (__bridge CFArrayRef)array, kCFPropertyListMutableContainers); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment