Re: KVC/KVO compliance of a container adding multiple objects
Re: KVC/KVO compliance of a container adding multiple objects
- Subject: Re: KVC/KVO compliance of a container adding multiple objects
- From: Ken Thomases <email@hidden>
- Date: Wed, 2 Jul 2008 07:04:42 -0500
Replying to myself...
On Jul 2, 2008, at 4:51 AM, Ken Thomases wrote:
You should probably implement your removeObjectsInArray: in terms of
-[NSArray indexOfObjectIdenticalTo:] and removeObjectsAtIndexes:.
You know what? That would probably be tedious and error-prone. Given
that you already have the other accessors, I actually think it might
be worth it to use [[self mutableArrayValueForKey:@"object"]
removeObjectsInArray:theArray]. Let the proxy returned by -
mutableArrayValueForKey: do the tedious work of figuring out how to do
the work in terms of the other accessors.
(Normally, I'm not fond of using -mutableArrayValueForKey: on self,
because there are usually more direct and efficient ways to accomplish
what you need. For this particular task, though, the alternative is
worse.)
Cheers,
Ken
_______________________________________________
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