Re: KeyboardType for an iOS searchBar.

2013-03-20 Thread Alex Zavatone

On Mar 20, 2013, at 1:27 PM, Matt Neuburg wrote:

 On Wed, 13 Mar 2013 17:54:40 -0400, Alex Zavatone z...@mac.com said:
 Yeah, that's the point. I know you can set it a la the storyboard, but once 
 it is set (once it's on the scene, the default is what is set) it's really 
 hard to change. 
 
 I have cases where the data the searchBar will be searching will all start 
 with numbers and other cases where it will all start with letters.
 
 Based on the data, I would like to display the default keyboard, or the 
 UIKeyboardTypeNumbersAndPunctuation keyboard.
 
 In any case, it appears to be very difficult to change the keyboard of the 
 searchBar when it is created by placing it in a scene in a storyboard.  
 
 If you know how to do it, I'd sure like to know how
 
 So you're saying you're setting the UISearchBar's keyboardType property but 
 it doesn't take? I wonder if it would help to locate the UISearchBar's 
 internal UITextField and set its keyboardType directly. I've found various 
 circumstances where this is necessary... Just an idea -

Correct.  It only appears to work (change to display the expected keyboard) if 
I set it from within searchBar:textDidChange

This means that the user has to already have entered text in the search field 
before the keyboard will change and then it will change just fine.  But that 
means that the keyboard is displayed for a little while and what is displayed 
is the keyboard that was set in the storyboard, not what I had reset it to in 
any previous routine.

I'll try out your suggestion.  Fingers crossed.  Thanks.

 m.
 
 --
 matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
 A fool + a tool + an autorelease pool = cool!
 Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do


___

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


KeyboardType for an iOS searchBar.

2013-03-13 Thread Alex Zavatone
Hopefully, this will be a more constructive question for the list.

On iOS in Xcode 4.2, I've put a storyboard scene together with a tableView and 
a searchBar.

The searchBar searches the tableView just fine, but my problem is how and when 
the storyboard defaults are applied to the searchBar and the resulting 
keyboard?  I ask, because it appears that it's only possible to override the 
storyboard defaults to set the keyboardType within the searchBar:textDidChange: 
method and this seems really clunky.

I'm using the methods below and I've tried setting the keyboardType on the 
viewController's viewDidLoad, viewDidAppear, after notification from 
UIKeyboardDidShowNotification, nothing works to override the setting used in 
the storyboard except for searchBar:textDidChange:, which is not acceptable.

[searchBar setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
[searchBar reloadInputViews];

I'm extending the interface to use the UISearchBarDelegate.  Is there anything 
obvious here that I might be missing?

TIA,
- Zav
___

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: KeyboardType for an iOS searchBar.

2013-03-13 Thread Diederik Meijer | Ten Horses
Maybe I'm missing the point, but you can set the keyboard type in the 
storyboard settings for it.. Or do you need to change it programmatically for 
some particular reason?




Op Mar 13, 2013, om 6:51 PM heeft Alex Zavatone z...@mac.com het volgende 
geschreven:

 Hopefully, this will be a more constructive question for the list.
 
 On iOS in Xcode 4.2, I've put a storyboard scene together with a tableView 
 and a searchBar.
 
 The searchBar searches the tableView just fine, but my problem is how and 
 when the storyboard defaults are applied to the searchBar and the resulting 
 keyboard?  I ask, because it appears that it's only possible to override the 
 storyboard defaults to set the keyboardType within the 
 searchBar:textDidChange: method and this seems really clunky.
 
 I'm using the methods below and I've tried setting the keyboardType on the 
 viewController's viewDidLoad, viewDidAppear, after notification from 
 UIKeyboardDidShowNotification, nothing works to override the setting used in 
 the storyboard except for searchBar:textDidChange:, which is not acceptable.
 
   [searchBar setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
   [searchBar reloadInputViews];
 
 I'm extending the interface to use the UISearchBarDelegate.  Is there 
 anything obvious here that I might be missing?
 
 TIA,
 - Zav
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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


Re: KeyboardType for an iOS searchBar.

2013-03-13 Thread Alex Zavatone
Yeah, that's the point. I know you can set it a la the storyboard, but once it 
is set (once it's on the scene, the default is what is set) it's really hard to 
change. 

I have cases where the data the searchBar will be searching will all start with 
numbers and other cases where it will all start with letters.

Based on the data, I would like to display the default keyboard, or the 
UIKeyboardTypeNumbersAndPunctuation keyboard.

In any case, it appears to be very difficult to change the keyboard of the 
searchBar when it is created by placing it in a scene in a storyboard.  

If you know how to do it, I'd sure like to know how.  Also, why is it so hard 
to override these UISearchBar properties defined by a storyboard setting?  I've 
run into other cases where it's really difficult to enable/disable the cancel 
button + other settings of a UISearchBar.

Thanks Diederik.

On Mar 13, 2013, at 5:42 PM, Diederik Meijer | Ten Horses wrote:

 Maybe I'm missing the point, but you can set the keyboard type in the 
 storyboard settings for it.. Or do you need to change it programmatically for 
 some particular reason?
 
 
 
 
 Op Mar 13, 2013, om 6:51 PM heeft Alex Zavatone z...@mac.com het volgende 
 geschreven:
 
 Hopefully, this will be a more constructive question for the list.
 
 On iOS in Xcode 4.2, I've put a storyboard scene together with a tableView 
 and a searchBar.
 
 The searchBar searches the tableView just fine, but my problem is how and 
 when the storyboard defaults are applied to the searchBar and the resulting 
 keyboard?  I ask, because it appears that it's only possible to override the 
 storyboard defaults to set the keyboardType within the 
 searchBar:textDidChange: method and this seems really clunky.
 
 I'm using the methods below and I've tried setting the keyboardType on the 
 viewController's viewDidLoad, viewDidAppear, after notification from 
 UIKeyboardDidShowNotification, nothing works to override the setting used in 
 the storyboard except for searchBar:textDidChange:, which is not acceptable.
 
  [searchBar setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
  [searchBar reloadInputViews];
 
 I'm extending the interface to use the UISearchBarDelegate.  Is there 
 anything obvious here that I might be missing?
 
 TIA,
 - Zav
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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