-
-
Save phuochau/7732b6cc7332a6d10aae4ade91f7b2aa 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