• 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
Table view data source methods order?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Table view data source methods order?


  • Subject: Table view data source methods order?
  • From: Chase Meadors <email@hidden>
  • Date: Mon, 3 Aug 2009 00:04:59 -0500

I'm having a bit of trouble here with table view data source methods. I have implemented. I have these three:

1) - (NSCell *)tableView:(NSTableView *)sender dataCellForTableColumn: (NSTableColumn *)tableColumn row:(NSInteger)row;
2) - (id)tableView:(NSTableView *)sender objectValueForTableColumn: (NSTableColumn *)tableColumn row:(NSInteger)row;
3) - (void)tableView:(NSTableView *)sender willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex;


I'm having trouble implementing what I want to implement. One column in my table view has some popup cells that have unique items to select from. In method 1) I'm returning a generic NSPopUpButtonCell if appropriate.

In method 2), I return an index based on a string in the list of values for that row.

In method 3), if the cell is one of my popups, I set it's menu to the list of values for that row.

Here's the problem. I'm returning the correct index for an object value in 2), but all of my popups have index 0 selected (with the correct list). The only reason I can think of is that cocoa follows this order:

1) call -objectValueFor...

2) THEN set the object value while the cell doesn't have it's list,

3) THEN call willDisplayCell...

Is there some way to implement this? They could simplify things by just giving direct access to the cell in the objectValueFor... method.'

Any help appreciated, thanks!


P.S. I did try to eliminate objectValueFor... and do everything in - willDisplayCell, but this doesn't work.


_______________________________________________

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: Table view data source methods order?
      • From: Andy Lee <email@hidden>
    • Re: Table view data source methods order?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: How to set the name of open-with application for a specific file?
  • Next by Date: Re: Table view data source methods order?
  • Previous by thread: Re: How to set the name of open-with application for a specific file?
  • Next by thread: Re: Table view data source methods order?
  • Index(es):
    • Date
    • Thread