• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
using a tableview delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: using a tableview delegate
      • From: Graham Cox <email@hidden>
    • Re: using a tableview delegate
      • From: Jack Carbaugh <email@hidden>
  • Prev by Date: Re: Main menu missing in 10.5. There in 10.6
  • Next by Date: Re: using a tableview delegate
  • Previous by thread: Re: Versioning / increasing build number
  • Next by thread: Re: using a tableview delegate
  • Index(es):
    • Date
    • Thread