Dismissing The Keyboard

2013-05-22 Thread Harmony Neil
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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Dismissing The Keyboard

2013-05-22 Thread Andreas Liebschner
On Wed, May 22, 2013 at 1:34 PM, Harmony Neil harmony.n...@gmail.com wrote:

 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.

Hello,

Give UIView's endEditing: method a try. Here is the doc (shortened
with google since Apple's doc URL are kinda messy):
http://goo.gl/Cs2Pw

You'd basically call it on the UIView containing these text fields.

PS: objc-language should not be used for email messages like this.
cocoa-dev is fine.

Andreas
___

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


Re: Dismissing The Keyboard

2013-05-22 Thread Hunter Hillegas
Take a look at [UIView endEditing].

On May 22, 2013, at 4:34 AM, Harmony Neil harmony.n...@gmail.com wrote:

 I preferably want to dismiss the keyboard for whichever of the 3 textFields 
 I'm writing in.

___

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


Re: Dismissing The Keyboard

2013-05-22 Thread Marcus Staloff

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Dismissing The Keyboard

2013-05-22 Thread Alex Zavatone
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