NSTableDataSource

NSTableDataSource Mac OS X 10.0

Methods in this informal protocol are implemented by classes that provide the data displayed in an NSTableView. At a minimum, data source classes must implement the methods numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:. Both of these methods are called frequently, so they should be efficient.

@interface NSObject (NSTableDataSource)
 // Instance Methods
   - (int)numberOfRowsInTableView:(NSTableView *)tableView;
   - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row;
   - (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn
           row:(int)row;
   - (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard;
   - (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
           proposedDropOperation:(NSTableViewDropOperation)op;
   - (BOOL)tableView:(NSTableView*)tv acceptDrop:(id <NSDraggingInfo>)info row:(int)row
           dropOperation:(NSTableViewDropOperation)op;
@end



    Part II: API Quick Reference
    Chapter 13. Foundation Classes