Binding to an NSMutableArray
Binding to an NSMutableArray
- Subject: Binding to an NSMutableArray
- From: Lorenzo Thurman <email@hidden>
- Date: Tue, 15 Feb 2011 22:37:52 -0600
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.
TIA
_______________________________________________
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