nstableview - Cocoa Bindings NSTableColumn cell title missing -
i have next models in application.
board, holds nsmutablearray property lists of type list below list, holds nsarray property cards of type card below card, has nsstring property name the relationship board --> to-many list --> to-many card
i have nscollectionview based master-detail interface working. in detail interface have nstableview wish populate.
bindings setup so:boardarraycontroller -> bound file's owner
** model key path: boards ** mode: class ** item prototype: board view itemlistarraycontroller -> bound boardarraycontroller.
** controller key: selection ** model key path: lists ** mode: class ** item prototype: list view itemcardarraycontroller -> bound listarraycontroller
** controller key: selection ** model key path: cards ** mode: classthe master collection view has content bound boardarraycontroller
** controller key: arrangedobjects
** selectionindexes bound boardarraycontroller.
the detail collection view has content bound listarraycontroller
** controller key: arrangedobjectsthe nstableview's column (in item prototype) bound cardarraycontroller
** controller key: arrangedobjects ** model key path: name problemthe detail interface's nstableview beingness populated right number of cards list. however, cell title empty. can click on rows , see selection, no text unfortunately.
there multiple table views, 1 each item in detail collection view, right? , content of each table view should reflect cards list represents. content of various table views should not affected list selected.
since there should multiple table views independent content, can't bound single array controller. want multiple cardarraycontrollers, 1 each item in detail collection view (a.k.a. each list).
the easiest way move collection view item view own nib. collection view item in first nib should configured nib name of secondary nib i'm describing. it's view outlet should not connected anything.
configure class of file's owner placeholder in secondary nib nscollectionviewitem, since that's load , own it. bindings in nib should go through representedobject property of placeholder object. there should array controller in nib, have cardarraycontroller. content bound file's owner.representedobject.cards.
so, each list selected board has corresponding item in detail collection view. item has representedobject set automatically particular list it's representing. collection view item load secondary nib build view. nib have both view (including table view) , array controller cards of list.
now, bind table view column (in secondary nib) cardarraycontroller (in same nib). that's assuming you're using nscell-based table view. if you're using view-based table view, need set bindings differently.
cocoa nstableview cocoa-bindings
No comments:
Post a Comment