• 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
Re: using a tableview delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using a tableview delegate


  • Subject: Re: using a tableview delegate
  • From: Jack Carbaugh <email@hidden>
  • Date: Fri, 5 Feb 2010 06:01:13 -0500

your controller, whether its a window controller or an array controller can be the delegate ... you either have to set it in IB or use tableViewObject setDelegate. since you are using an arraycontroller to drive the table, i'd recommend placing it there.


On Feb 5, 2010, at 5:55 AM, Michael Thon wrote:

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

_______________________________________________

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


References: 
 >using a tableview delegate (From: Michael Thon <email@hidden>)

  • Prev by Date: using a tableview delegate
  • Next by Date: Re: using a tableview delegate
  • Previous by thread: using a tableview delegate
  • Next by thread: Re: using a tableview delegate
  • Index(es):
    • Date
    • Thread