I have a small cocoa app, and the UI consists mainly of a single NSTableView. However I have 2 different lists of data that I would like to display in it, and then just toggle between the two. My question is, what do you think is the best way to implement this?
Now I figure I could use a BOOL flag to change which Array gets used in the dataSource methods. But I would also need to change the NSCell class that is used because the lists contain completely different data objects. Then I would need to reload the table (would [table reloadData] reload all this reliably?).
Or, I could create 2 seperate NSTableViews in my NIB file and toggle their visibility... But this seems hackish.
I have a pretty good understanding of Cocoa, but I'm not really sure how to search for something like this, and I'm curious how other more experienced devs would solve this problem.
Thanks.