osx - Static NSTableView with preset rows -


is possible create nstableview in interface builder has preset number of rows table can used form?

i have view requires form of various labels , textfields. i've tried using single labels , textfields looks poor. same nsform additional put couple of restrictions on layout , cell content.

so table view looks polished form view. optimally drag 7 texttableviewcells static nstableview in ib , set labels in first column , dynamically set values in second column rows.

but if build 7 rows disappeared. how can nstableview act static?

as @anc ainu pointed out, of os x 10.10 possible use static tableviews in os x. have set usesstaticcontents property on nstableview make behave static tableview on ios. according docs:

a static table not rely on data source provide number of rows. static table view’s contents set @ design time , can changed programmatically needed. typically, not change contents of static table view after setting them.

in xcode, rows add static table saved in corresponding nib or storyboard file , loaded rest of table @ runtime. can add table rows programmatically static table view using insertrowsatindexes:withanimation: method. when adding rows programmatically, table view delegate must implement tableview:viewfortablecolumn:row: method provide corresponding view new rows. can remove rows @ time using removerowsatindexes:withanimation: method.

please remember property 1 available on os x 10.10 , later.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -