Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSArray *items = @[@1, @2, @"Three"];
- NSDictionary *d = @{@"items" : items};
- NSMutableDictionary *md = [d mutableCopy];
- id mitems = md [@"items"];
- NSLog (@"items %p == %p mutable items? %i", items, mitems, items == mitems);
- // fail: -[__NSArrayI addObject:]: unrecognized selector
- //[mitems addObject: @"Four"];
- NSMutableDictionary *md2 =
- (id)CFBridgingRelease
- (CFPropertyListCreateDeepCopy (NULL, (CFPropertyListRef)d,
- kCFPropertyListMutableContainers));
- id mitems2 = md2 [@"items"];
- NSLog (@"items %p == %p mutable items? %i", items, mitems2, items == mitems2);
- // OK
- [mitems2 addObject: @"Four"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement