Re: NSTextFieldCell "challenge"
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