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 (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 arch...@mail-archive.com

Reply via email to