Assign TableView column binding to a specific core-data object in to-many related entity based on se
Posted
by snown27
on Stack Overflow
See other posts from Stack Overflow
or by snown27
Published on 2010-04-29T04:40:50Z
Indexed on
2010/04/29
4:47 UTC
Read the original article
Hit count: 182
How would I assign a column of a TableView to be a specific entry in a Core Data entity that is linked to the NSArrayController via a to-many relationship?
For example
Entity: MovieEntity
Attributes: title(NSString), releaseDate(NSDate)
Relationship: posters<-->> PosterEntity
Entity:PosterEntity
Attributes: imageLocation(NSURL), default(BOOL)
Relationships: movie<<--> MovieEntity
So I have a three column table that I want to display the Poster, Title, and Release Date attributes in, but as one movie could potentially have several different style's of posters how do I get the poster column to only show the one that's marked default?
Since the rest of the table is defined in Interface Builder I would prefer to keep it that way for the sake of keeping the code as clean as possible, but if this can only be done programmatically then I'm all ears. I just wanted to give preference in case there's more than one way to skin a cat, so to speak.
© Stack Overflow or respective owner