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

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.

  • Prev by Date: Proper way to run runloop for DO server?
  • Next by Date: Screen saver with shared contexts
  • Previous by thread: Re: Proper way to run runloop for DO server?
  • Next by thread: Screen saver with shared contexts
  • Index(es):
    • Date
    • Thread