On 22/09/2009, at 10:40 PM, BareFeet wrote:

2. Does addObject: and insertObject: actually just get the whole array, add the extra object, then write the whole array back to the instance variable? I thought it would be more efficient than that.


Not sure why you think this is inefficient, especially. An array in this context is just a pointer to the array object - fetching the "whole array" doesn't move anything, it just returns the pointer. "Writing back" means what exactly? Doing a retain/release? That also doesn't move or copy anything - it's super-cheap. If the array is copied along the way there may be some overhead but it may not be all that much.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to