• 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: Setting data cell type for a specific row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting data cell type for a specific row


  • Subject: Re: Setting data cell type for a specific row
  • From: Ken Tozier <email@hidden>
  • Date: Tue, 27 Jan 2009 01:49:04 -0500


On Jan 26, 2009, at 7:45 PM, I. Savant wrote:

 ... sorry?

How does implementing one delegate method that's directly targeted at the very problem you're trying to solve "complicate things"?

I was confused about what to return from the method if I just wanted the data cell preserved as is. It turned out to be really simple, but the solution didn't hit me on the first few passes.


- (NSCell *) tableView:(NSTableView *) tableView
	dataCellForTableColumn:(NSTableColumn *) tableColumn
	row:(NSInteger) row
{
	if ([[tableColumn identifier] isEqualToString: @"delete"] &&
		(row == [[controller arrangedObjects] count] - 1))
		return addCell;
	else
		return [tableColumn dataCellForRow: row];
}

Thanks for your help. It was in typing up a rebuttal, that I stumbled upon this solution. Simple, clean, elegant. I guess delegates DO have a purpose :)

Thanks again

- Ken
_______________________________________________

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: Setting data cell type for a specific row
      • From: "I. Savant" <email@hidden>
References: 
 >Re: Setting data cell type for a specific row (From: email@hidden)
 >Re: Setting data cell type for a specific row (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: How to catch and log EXC_BAD_ACCESS?
  • Next by Date: Re: Not Resolving Aliases
  • Previous by thread: Re: Setting data cell type for a specific row
  • Next by thread: Re: Setting data cell type for a specific row
  • Index(es):
    • Date
    • Thread