Re: Binding a model's ivar array to the contents of an NSArrayController
Re: Binding a model's ivar array to the contents of an NSArrayController
- Subject: Re: Binding a model's ivar array to the contents of an NSArrayController
- From: Todd Heberlein <email@hidden>
- Date: Wed, 16 Sep 2009 09:35:43 -0700
So in short, my need is pretty simple: Bind an array to an
NSArrayController. That being said, it seems that no combination of
exposeBindings:, bind:toObject:withKeypath:options:,
observeValueForKey:ofObject:change:context:, etc. is working as I
expect it to. Admittedly, I have done most of my binding work via
IB and I've never really done much with
bind:toObject:withKeypath:options: before, so I wouldn't be
surprised to find that that was where my problem lay.
Might be a stupid question on my part, but are you using the
appropriate accessors for your array? For example, if you have
@interface MyDocument : NSDocument
{
NSMutableArray* myStuff;
}
You then need use accessors of the form:
-(NSUInteger)countOfMyStuff;
-(id)objectInMyStuffAtIndex:(NSUInteger)index;
-(void)insertObject:(id)newObj inMyStuffAtIndex:(NSUInteger)index;
-(void)removeObjectFromMyStuffAtIndex:(NSUInteger)index;
Todd
_______________________________________________
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