• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: KVC/KVO compliance of a container adding multiple objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >KVC/KVO compliance of a container adding multiple objects (From: Graham Cox <email@hidden>)
 >Re: KVC/KVO compliance of a container adding multiple objects (From: mmalc Crawford <email@hidden>)
 >Re: KVC/KVO compliance of a container adding multiple objects (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: KVO Bug With Keypaths
  • Next by Date: Re: KVC/KVO compliance of a container adding multiple objects [SOLVED]
  • Previous by thread: Re: KVC/KVO compliance of a container adding multiple objects
  • Next by thread: Re: KVC/KVO compliance of a container adding multiple objects [SOLVED]
  • Index(es):
    • Date
    • Thread