using a tableview delegate
using a tableview delegate
- Subject: using a tableview delegate
- From: Michael Thon <email@hidden>
- Date: Fri, 5 Feb 2010 11:55:07 +0100
I have bound an NSTableView to an array controller which is set to entity mode to fetch data from the managed object context. I would like override a method in the table view delegate protocol to control how data are displayed in the cell. When I set the table view's delegate to the window controller I get this error whenever I delete the last element in the table (using the remove: method of the array controller):
*** -[NSArray objectAtIndex:]: index (0) beyond bounds (0)
I get this error even when I have not actually overridden any of the delegate methods, I have only set the delegate to the window controller. Is there a method in the NSTableViewDelegate protocol that I'm required to override? I thought they were all optional.
The table view programming guide states that the table view delegate is usually the same object that provides data to the table view. In my case it would be an NSArrayController. Instead of putting my delegate methods in the window controller, should I instead subclass NSArrayController and put the delegate methods in there? Doesn't make sense to me to make a subclass just to add delegate methods.
Thanks
Mike_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden