Re: Binding to an NSMutableArray
Re: Binding to an NSMutableArray
- Subject: Re: Binding to an NSMutableArray
- From: "Stephen J. Butler" <email@hidden>
- Date: Tue, 15 Feb 2011 22:42:02 -0600
On Tue, Feb 15, 2011 at 10:37 PM, Lorenzo Thurman <email@hidden> wrote:
> I have an object, Student, that contains firstName and lastName as instance
> variables. Student also contains an NSMutableArray of infraction objects
> that contains NSString's for the infraction name, location, punishment and
> an NSDate. I want to bind these infraction objects to the columns of an
> NSTableView. What I've done to make this work is copy the infraction object
> to another NSArray when the Student is loaded and binding the table columns
> to the NSArrayController associated with this new array. Obviously, this is
> suboptimal. It seems to me that I should be able to bind directly to the
> infraction as it resides in the Student object, but I just can figure out
> how to bind to a particular index within the NSMutableArray within the
> Student object. I've looked at some examples here:
> http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
>
> but I didn't find anything quite like what I'm doing. I've gone back through
> the KVC/KVO documents to see if I'm missing something. Does anyone have any
> pointers on how I can go about this? If its possible at all.
Assuming that your Students are in an NSArray themselves, and that
there exists a Students Array Controller, did you try binding the
Infractions Array Controller to the Students Array
Controller.selection.infractions?
_______________________________________________
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