• 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
dataCellForTableColumn method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dataCellForTableColumn method


  • Subject: dataCellForTableColumn method
  • From: Hans Hansen <email@hidden>
  • Date: Wed, 19 Mar 2008 11:58:12 -0700

Anyone know how best to use multiple NSTextCell subclasses, in a table/ outline column?

When I use the dataCell... methods in NSTableColumn, NSTableView, or NSOutlineView, it works great until I try to edit the cell, at which point the cells never receive the edit/select actions. I've tried lots of things but can't figure out what's happening, nor a better why to do this overall.

In other words:

When I use the dataCellForTableColumn method, my table does display the different textcell subclasses returned. But when I send the table/ outline [self editColumn:1 row:[self selectedRow] withEvent:theEvent select:YES] message it seems to get lost -- my specified cells don't receive an editWithFrame/selectWithFrame action. If I remove this method and only use one cell class in the column, it works as expected.

- (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item {

	if ([item isKindOfClass:[Project class]]) return projectTextCell;
	if ([item isKindOfClass:[Action class]]) return actionTextCell;
	if ([item isKindOfClass:[Item class]]) return itemTextCell;
	if ([item isKindOfClass:[Note class]]) return noteTextCell;

	return nil;
}

The point of this is to breakout my cell designs for efficiency and comprehension. But so far it's just making me nuts. ;-).

Any suggestions??

--

Hans Hansen
Midnight Beep Softworks




_______________________________________________

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: dataCellForTableColumn method
      • From: Ben Lachman <email@hidden>
  • Prev by Date: Re: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Next by Date: disabling NSButton?
  • Previous by thread: Re: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Next by thread: Re: dataCellForTableColumn method
  • Index(es):
    • Date
    • Thread