cocoa - Best way to handle multiple NSTableView(s) -


Is the best way to handle multiple NSTableViews without using coke bindings?

In my app, I have two NSTableViews that are closely related to the fact that I am using the same object for both representative and data source. The problem calls both tableviews in the same way. I currently discriminate between two table scenes on the basis of NCCTOR-TAG.

Deep I go into this code, to make a difference between table views in each representative / data source method, I'm making a duplicate code to a great extent. I will end the code, especially non-object Oriented

I can create a separate object to control one or the other table view, but it is said that the creation of the object will be largely artificial to provide a specific representative / datasource.

Are all people now using cocoa binding? I am avoiding binding because I want to make my cocoa skills on the techniques transferable between the Mac OS and the iPhone.

Each representative / datasource method for NSTableView gives an example of NSTableView that calls it the first parameter (Except for those passing the DNS encryption object, in which case NSNotification's object is the table view example). Some examples include:

- (int) numberOfRowsForTableView: (NSTableView *) aTableView;

- (ID) Table view: (NSTableView *) ATableView objectValueForTableColumn: (NSTableColumn *) aTableColumn Row: (NSInteger) rowIndex

< Code> - (Zero) Change the table view selection deed: (NSNotification *) An alert

If you are using a controller object as a delegate / data source for multiple controllers , You can use that parameter to differentiate between them.


Comments