• 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: NSTextFieldCell "challenge"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell "challenge"


  • Subject: Re: NSTextFieldCell "challenge"
  • From: j o a r <email@hidden>
  • Date: Fri, 17 Dec 2004 10:36:55 +0100


On 2004-12-17, at 10.30, Geert B. Clemmensen wrote:

I have a subclassed NSControl that among other things hold a NSTexFieldCell (textCell). When editing of the the cell, using the standard field editor, is ended, this textDidEndEditing: method gets invoked:

- (void) textDidEndEditing:(NSNotification*) notification
{
   NSTextView* e   = [notification object];
   NSString*   str = [NSString stringWithFormat:@"%@", [e string]];

   [textCell setStringValue:str];
   [textCell endEditing:e];

   NSLog(@"New  textCell=%@", [textCell stringValue]);

   [e setString:@""];

   NSLog(@"Done textCell=%@", [textCell stringValue]);

   ...
}

The spooky part, or at least so I believe, is the [e setString:@""] call, i.e. the field editor contents is supposedly cleared, BUT the textCell's string value is ALSO cleared (actually it is set to the same value as the field editor is set to). Here is NSLog output (editing the text cell twice)

First of all, why do you reset the value of the field editor?

j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSTextFieldCell "challenge" (From: "Geert B. Clemmensen" <email@hidden>)

  • Prev by Date: Re: Wrapping an Interactive Unix Executable (update)
  • Next by Date: Re: best way to handle periodic table of the elements
  • Previous by thread: NSTextFieldCell "challenge"
  • Next by thread: [NSHost currenthost] slooooooooooow
  • Index(es):
    • Date
    • Thread