cocoa - NSTableView makeViewWithIdentifier across nibs -


i have similar question cocoa - view-based nstableview, using 1 cell in multiple tables, amplified apple's own docs makeviewwithidentifier:owner:

"typically identifier associated external nib in interface builder , table view automatically instantiate nib provided owner."

this seems imply should able store nstablecellview in separate nib nib containing nstableview. however, in experimenting, have ever been able obtain cells contained within tableview i'm calling on. i.e., if cut , paste cell new .xib file, tableview can no longer find it. doing wrong, or impossible , somehow misreading apple's docs?

i ran problem , think cannot use makeviewwithidentifier:owner: when you're using dedicated nib populate view-based tables.

the problem has file owners (ie. view controllers). makeviewwithidentifier:owner: seems intended used "self" owner simple custom views.

generally if have separate nib custom view outlets, you're going want separate view controller too. otherwise, if custom view has outlet , table displays many custom views, outlet referring "self" table view owner?

so in test, i've got appdelegate delegate/datasource of table view. have cellview.xib, , cellviewcontroller.h/.m outlets interface. in tableview:viewfortablecolumn:row: delegate method have code:

sscellviewcontroller *vc = [[sscellviewcontroller alloc] initwithnibname:@"cellview" bundle:nil]; return vc.view; 

what lose cell re-use happens automatically makeviewwithidentifier:owner:. implement yourself, you'll have deal managing many view controllers you've created.

i might still missing something, i'm coming os x development after years of doing ios work.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -