No, it does not return a copy.
NSMutableArray *array = [NSMutableArray new]; NSMutableDictionary *dict = [NSMutableDictionary new]; NSLog(@"local instance of array: %p", array); [dict setObject: array forKey: @"key"]; NSLog(@"returned from dictionary: %p", [dict objectForKey: @"key"]);
Output:
2012-09-16 14:06:36.879 Untitled 3[65591:707] local instance of array: 0x7f98f940a2f0 2012-09-16 14:06:36.884 Untitled 3[65591:707] returned from dictionary: 0x7f98f940a2f0
The same pointer is returned to you, that is, the object was not copied.
source share