PDA

View Full Version : NSTableView - Delegate when empty?




satyam90
Apr 14, 2008, 12:24 AM
Hi, I am using Cocoa famework with Obj C.
I have a NSTableView control in my panel. I want to have a delegate or some method which will check for the contents of the table view, when empty it should close the panel. I know how to close the panel. But I am searching for some delegate which will check the nil entries in the table view.
(I am using some other nib controllers array controller to add/delete entries in panel's table view.)



HiRez
Apr 14, 2008, 02:22 AM
Hi, I am using Cocoa famework with Obj C.
I have a NSTableView control in my panel. I want to have a delegate or some method which will check for the contents of the table view, when empty it should close the panel. I know how to close the panel. But I am searching for some delegate which will check the nil entries in the table view.
(I am using some other nib controllers array controller to add/delete entries in panel's table view.)Maybe you could override on of the array controller's methods (like arrangedObjects: or something that's called periodically by the bindings system), and check for emptiness there?

EDIT: Or maybe override numberOfRowsInTableView: from the table view's data source, which I think gets called before it gets display updates.

Eraserhead
Apr 14, 2008, 07:55 AM
EDIT: Or maybe override numberOfRowsInTableView: from the table view's data source, which I think gets called before it gets display updates.

That only works for the data source.