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

Re: dataCellForTableColumn method


  • Subject: Re: dataCellForTableColumn method
  • From: Ben Lachman <email@hidden>
  • Date: Wed, 19 Mar 2008 21:53:03 -0400

Make sure the field editor isn't getting in the way. The field editors inserts itself into the first responder chain and grabs textual input during editing.

<http://developer.apple.com/documentation/Cocoa/Conceptual/ TextEditing/Tasks/FieldEditor.html>

HTH,

->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email@hidden
740.590.0009



On Mar 19, 2008, at 2:58 PM, Hans Hansen wrote:

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. ;-).

_______________________________________________

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: Hans Hansen <email@hidden>
References: 
 >dataCellForTableColumn method (From: Hans Hansen <email@hidden>)

  • Prev by Date: Re: Where's the buffer overrun?
  • Next by Date: Re: Perform Selector After Delay Secondary Window
  • Previous by thread: dataCellForTableColumn method
  • Next by thread: Re: dataCellForTableColumn method
  • Index(es):
    • Date
    • Thread