[sending again, because I accidentally posted with the wrong, non- subscribed email address]

On Aug 25, 2008, at 1:55 AM, Pierre Chatelier wrote:

Hello,

I was wondering something...
I have an NSTableView which is automatically filled by binding. So, I did not set any dataSource. But I want to implement "tableView:writeRowsWithIndexes:toPasteboard:", which is a dataSource method. So, I set some object to be the dataSource, implementing the method. At run-time, it complains that the dataSource should implement numberOfRowsInTableView:. I had to implement such a method, but the return value remains unused since the bindings are responsible for feeding.

My question is : yes, it works, but what is logical to do ? Should I also implement dummy "tableview:objectValueForTableColumn:row:" and others methods that are theoretically required for a datasource, but practically unused when using bindings ?

Regards,

Pierre Chatelier


Pierre,

I've run into this before. IIRC, the following should be sufficient to make AppKit happy:

-(int)numberOfRowsInTableView:(NSTableView*)aTableView
{ return 0; }

-(id)tableView:(NSTableView*)aTableView objectValueForTableColumn: (NSTableColumn*)aTableColumn row:(int)rowIndex
{ return nil; }

-Jeff

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to