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 <harmony.n...@gmail.com> 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 (Cocoa-dev@lists.apple.com) >> >> 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: >> https://lists.apple.com/mailman/options/cocoa-dev/mstaloff%40verizon.net >> >> This email sent to mstal...@verizon.net > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com > > This email sent to z...@mac.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com