ResignFirstResponder
ResignFirstResponder
- Subject: ResignFirstResponder
- From: Francisco Tolmasky <email@hidden>
- Date: Tue, 18 Mar 2003 18:38:10 -0800
Ok, I've been trying to use resignFirstResponder, but for some reason,
whenever my textfield is clicked, it gets sent the
resignFirstResponder. Isn't only supposed to be sent this when it is
about to resign first responder status? I am making a search textfield
like with this:
- (BOOL)becomeFirstResponder
{
if(!_keyEntered)
{
[self setStringValue: @""];
[self setTextColor: [NSColor blackColor]];
}
return [super becomeFirstResponder];
}
- (BOOL)resignFirstResponder
{
NSLog(@"hello");
BOOL resign= [super resignFirstResponder];
if(resign) // its ok to resign
{
if([[self stringValue] isEqualToString: @""])
{
[self setStringValue: @""];
[self setTextColor: [NSColor blackColor]];
}
}
return resign;
}
Now, it says "Search" when I click it, but does nothing when I unclick
it. For some reason resignfirstresponder is being sent before
becomeFirstResponder (and is returning YES) and not when I click away
from it. Is this typical behavior? Am I misusing resignFirstResponder?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.