osx - NSTableBackgroundView -


i have viewcontroller has single tableview within content. within viewcontroller access actual table via:

nsview * myview = self.view.subviews[0]; myview = myview.subviews[0]; nstableview *mytable = myview.subviews[0]; [self.targets sortusingdescriptors: [mytable sortdescriptors]]; [mytable reloaddata]; 

this clumsy seems work. except when mouse down within table when vertical scroll bars active. then, raise exception because in final line of accessing subviews reach mytable, subview array has several nstablebackgroundviews before actual tableview created , want access.

nstablebackgroundview apparently not documented , not have sortdescriptors method (hence exception).

perhaps can point out better way table more reliable, or can whether enumerating final subview array find desired classof nstableview safe?

many thanks!

in lieu of other answers, implemented planb, took array of subviews , enumerated on them find actual nstableview. seems work when bang on ui test , no more flags raised.

i wish there cleaner way discover view want without traversing subviews.


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 -