KVC/KVO compliance of a container adding multiple objects
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