i was just wondering how to set a NSTableCellView to show a specific string depending on what option a user selected from a NSPopUpButton, any and all help would be greatly appreciated…
I would like to do this without using binding also
i was just wondering how to set a NSTableCellView to show a specific string depending on what option a user selected from a NSPopUpButton, any and all help would be greatly appreciated…
I would like to do this without using binding also
Maybe I dont understand you correctly but wouldnt it be the easiest way to just implement what is needed for NSTableViewDataSources, that is
-numberOfRowsInTableView
-tableView:objectValueForTableColumn:row
and return to your Table View, what might be needed. As far as I know, this even works with your NSTableCellView.
You could use the IBAction your Button causes and use
reloadData
on the Table View.
By the way, usually Table Views are intended to show large amounts of data. If you only want to show a short statement depending on the button selection consider using a NSTextField instead.
First, make sure you understand the Model-View-Controller design pattern. You need to do three things:
Also, why do you want to do this without bindings? Bindings are often simpler and easier than creating your own NSTableViewDataSource. For some complex problems you have to do the work yourself, but if bindings will solve the problem, they are often the best solution.