• 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: Dismissing The Keyboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dismissing The Keyboard


  • Subject: Re: Dismissing The Keyboard
  • From: Alex Zavatone <email@hidden>
  • Date: Wed, 22 May 2013 20:41:05 -0400

This is what I use when using a UISearchBar in iOS.

-(void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar {
    [aSearchBar resignFirstResponder];
}

By using the _ char in front of your var, it looks like you're talking directly to the private instance.  If you have a textfield called txt1, does it work if you try this:

[self.txt1 resignFirstResponder];

??

Did you forget to synthesize your property?  I actually ran into that today in Xcode 4.6.1 but only because I had started to @synthesize some vars and I think Xcode was trying to predict how I wanted the class vars to be scoped.

On May 22, 2013, at 7:45 PM, Marcus Staloff wrote:

>
> Do you also have the text field hooked up to File Owner's delegate?
> That needs to be done to dismiss KB.
>
> On May 22, 2013, at 7:34 AM, Harmony Neil <email@hidden> wrote:
>
>> Hellow,
>> I'm using the numberpad for entering text in the textFields in my iPhone app which is fine, but for some reason I've resigned firstResponder to all the textFields so I can dismiss the keyboard when I press the calculate button, but when I press said button, the keyboard just stays on the screen.
>> Does anyone know what is the best way of dismissing the keyboard?  I preferably want to dismiss the keyboard for whichever of the 3 textFields I'm writing in.  Also, I've called my textFields txt1, txt2 and txt3 to make it easier, but I had to put an _ character when I wrote the resignFirstResponder lines for the app to even build and run.
>> Thanks for any help/suggestions,
>> Harmony.
>> _______________________________________________
>>
>> 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
>
>
> _______________________________________________
>
> 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


_______________________________________________

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

References: 
 >Dismissing The Keyboard (From: Harmony Neil <email@hidden>)
 >Re: Dismissing The Keyboard (From: Marcus Staloff <email@hidden>)

  • Prev by Date: Re: Creating More Than 1 Of The Same Element/control
  • Next by Date: Crash in CFPreferencesSetAppValue
  • Previous by thread: Re: Dismissing The Keyboard
  • Next by thread: Crash in CFPreferencesSetAppValue
  • Index(es):
    • Date
    • Thread