• 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
KVC/KVO compliance of a container adding multiple objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVC/KVO compliance of a container adding multiple objects


  • Subject: KVC/KVO compliance of a container adding multiple objects
  • From: Graham Cox <email@hidden>
  • Date: Wed, 2 Jul 2008 09:33:34 +1000

I have a container class which has a mutable array.

To allow it to be KVC/KVO compliant, I'm implementing:

- (void) setObjects:(NSArray*) objs; // KVC/KVO compliant
- (NSArray*) objects; // KVC/KVO compliant
- (int) countOfObjects; // KVC/KVO compliant
- (thing*) objectInObjectsAtIndex:(int) index; // KVC/KVO compliant
- (void) insertObject:(thing*) obj inObjectsAtIndex:(int) index; // KVC/KVO compliant
- (void) removeObjectFromObjectsAtIndex:(int) index; // KVC/KVO compliant
- (void) replaceObjectInObjectsAtIndex:(int) index withObject:(thing*) obj; // KVC/KVO compliant


I also have a number of methods that allow "things" to be added from arrays, or indexed by an index set. Is there a way to make these KVC/ KVO compliant or would they all
have to call through to one or more of these methods to ensure that?


For example:

- (void) addObjectsFromArray:(NSArray*) objs atIndexes:(NSIndexSet*) set;
- (void) removeObjectsInArray:(NSArray*) objs;
- (void) removeObjectsAtIndexes:(NSIndexSet*) set;


tia,

Graham
_______________________________________________

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


  • Follow-Ups:
    • Re: KVC/KVO compliance of a container adding multiple objects
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: Re: Best way to handle background i/o and notify main UI thread
  • Next by Date: Re: Regarding Iphone
  • Previous by thread: Re: Getting mouse moved events on overlay windows
  • Next by thread: Re: KVC/KVO compliance of a container adding multiple objects
  • Index(es):
    • Date
    • Thread