• 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: Selectively using formatter in table view text cell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selectively using formatter in table view text cell


  • Subject: Re: Selectively using formatter in table view text cell
  • From: Graham Cox <email@hidden>
  • Date: Wed, 24 Jun 2009 16:36:23 +1000


On 24/06/2009, at 4:00 PM, Quincey Morris wrote:

(a) Use the delegate, something like (untested, obviously):

-(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
if (!<this is the correct column>)
return;
id objectValue = [self.delegate tableView: self objectValueForTableColumn:aTableColumn row:rowIndex;
// or find the data directly from your data model, if not using a data source
if (objectValue isKindOfClass: [NSNumber class])
aCell.formatter = myFormatter;
else
aCell.formatter = nil;
}


Thanks! That works fine and was very easy...

--Graham


_______________________________________________

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: 
 >Selectively using formatter in table view text cell (From: Graham Cox <email@hidden>)
 >Re: Selectively using formatter in table view text cell (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: about NSThread crash
  • Next by Date: Re: about NSThread crash
  • Previous by thread: Re: Selectively using formatter in table view text cell
  • Next by thread: about NSThread crash
  • Index(es):
    • Date
    • Thread