Re: mutableArrayValueForKey: truth or dare
Re: mutableArrayValueForKey: truth or dare
- Subject: Re: mutableArrayValueForKey: truth or dare
- From: Mike Abdullah <email@hidden>
- Date: Thu, 17 Jun 2010 18:10:03 +0100
On 17 Jun 2010, at 17:47, Matt Neuburg wrote:
> There is an assertion often encountered in people's blogs, answers to
> questions on forums, etc., that the proxy object provided by
> mutableArrayValueForKey: is inefficient
This is wrong. The proxy only occurs a slight performance penalty over direct calling the accessor methods (in most cases 1 message send)
> - in particular, that if you don't
> also implement -countOfItems, -objectInItemsAtIndex:,
> -insertObject:inItemsAtIndex:, and -removeObjectFromItemsAtIndex:,
> then every change in the mutable array through the proxy replaces the whole
> array. Is this true? Thx - m.
This is true. How else could the proxy do its work? The docs are pretty helpful on how the proxy decides what to do.
Mike._______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden