Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-10-2010, 09:46 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 19
aaronsbush is on a distinguished road
Default UIKeyboard in iphone 4.0

My app has a custom decimal point that appears on the number pad when the user invokes the keyboard. I'm using the (void)keyboardWillShow command.

It stopped working on the 4.0 OS. Does anyone know if Apple changed the way this works in 4.0?

Thanks!
aaronsbush is offline   Reply With Quote
Old 04-21-2010, 04:49 AM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Location: Krala,India
Posts: 32
preethaAjayan is on a distinguished road
Default

Hi,

I am also facing the same problem. For me 'keyboardWillShow' is firing. But in that event i hide the UIKeyboard view. That thing is not working.
preethaAjayan is offline   Reply With Quote
Old 04-21-2010, 07:21 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 19
aaronsbush is on a distinguished road
Default

I did find the code to correct this. My original code looked like this:

if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES {

}

The code needs to be changed to below: This code works in 3.2 and 4.0.
if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES || [[keyboard description] hasPrefix:@"<UIPeripheralHostView"] == YES) {

}

That was all I had to change. I hope this helps you!
aaronsbush is offline   Reply With Quote
Old 05-09-2010, 12:07 PM   #4 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 19
aaronsbush is on a distinguished road
Default

Well I'm back to same issue again. The decimal works on the iPad 3.2 but not on the latest beta for iPhone 4.0. Anyone have an idea how to fix this?
aaronsbush is offline   Reply With Quote
Old 05-19-2010, 05:00 AM   #5 (permalink)
Registered Member
 
Ivan's Avatar
 
Join Date: Oct 2008
Location: Christchurch, NZ
Posts: 120
Ivan is on a distinguished road
Default

Quote:
Originally Posted by aaronsbush View Post
Well I'm back to same issue again. The decimal works on the iPad 3.2 but not on the latest beta for iPhone 4.0. Anyone have an idea how to fix this?
It is still not working in Beta4

I know Apple would prefer developers to use the new public API UITextView inputView property (as of OS3.2) but is it possible to write code that is backward compatible? e.g. use the hasPrefix:@"<UIKeyboard" method if the OS is older than 3.2 or use inputView property for 3.2 and over.

Is seems a bit of a chicken and egg situation. Compile as 4.0 and it won't run on a older OS. Compile for older OS and the inputView property doesn't exist to be able to be called.

Any thoughts?
Cheers
Ivan
__________________
New game: Doodle Blitz - addictive, casual gaming.
iPhone games and utilities at http://www.ivanmackintosh.com. Updates and promos on Twitter
Ivan is offline   Reply With Quote
Old 05-19-2010, 07:19 AM   #6 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

You compile for the latest, set deployment target to the lowest you need, and when facing this kind of situation, conditionally run either code
Code:
if ([[UIDevice currentDevice].systemVersion floatValue] >= 3.2) {
//new code;
} else {
//legacy code;
}
nobre84 is offline   Reply With Quote
Old 05-19-2010, 07:22 AM   #7 (permalink)
Physician developer
 
StatCoder's Avatar
 
Join Date: Aug 2008
Location: Austin, TX
Posts: 221
StatCoder is on a distinguished road
Default

I have the exactly the same problem. I'm not that great of a coder so I'd rather not create and maintain my own individual solution for the numeric keypad with a decimal because I will probably screw it up in some way. Who knows what will or will not work with the new hardware comes out with different screen resolutions next month? However, I've got a few apps that are going to need to be updated before OS4 is released to the general public so that probably means it will need to be addressed by the beginning of WWDC.
StatCoder is offline   Reply With Quote
Old 05-22-2010, 05:27 AM   #8 (permalink)
Registered Member
 
Ivan's Avatar
 
Join Date: Oct 2008
Location: Christchurch, NZ
Posts: 120
Ivan is on a distinguished road
Default

@nobre84, thanks for that tip it works great for me.
__________________
New game: Doodle Blitz - addictive, casual gaming.
iPhone games and utilities at http://www.ivanmackintosh.com. Updates and promos on Twitter
Ivan is offline   Reply With Quote
Old 05-22-2010, 04:10 PM   #9 (permalink)
Physician developer
 
StatCoder's Avatar
 
Join Date: Aug 2008
Location: Austin, TX
Posts: 221
StatCoder is on a distinguished road
Default

Ivan:

If you found a solution to the problem of adding a decimal button to the numeric keypad under OS4, would you post some info on it? Thanks.
StatCoder is offline   Reply With Quote
Old 05-22-2010, 07:21 PM   #10 (permalink)
Registered Member
 
Ivan's Avatar
 
Join Date: Oct 2008
Location: Christchurch, NZ
Posts: 120
Ivan is on a distinguished road
Default

Quote:
Originally Posted by StatCoder View Post
Ivan:

If you found a solution to the problem of adding a decimal button to the numeric keypad under OS4, would you post some info on it? Thanks.
I'm afraid I don't know the answer to that one. In my case I have a whole keyboard already defined. I was using the <UIKeyboard trick to ensure my keyboard was on top of the Apple one. In OS4 my keyboard just disappeared so now I have the code in place that says
if OS >= 3.2 then
use UITextView inputView
else
use the <UIKeyboard trick

Screen shots of the project can be seen at HotTyper.com if you want to see what I am doing to the keyboard.

Ivan
__________________
New game: Doodle Blitz - addictive, casual gaming.
iPhone games and utilities at http://www.ivanmackintosh.com. Updates and promos on Twitter
Ivan is offline   Reply With Quote
Old 08-03-2010, 01:54 PM   #11 (permalink)
cye
14 Year Old App Developer
 
Join Date: Mar 2010
Location: Texas
Posts: 242
cye is on a distinguished road
Default

use
textView.inputView = myCustomKeyboard;
__________________
14 year old app developer!

Type Faster and More Accurately With Easy Typing

"Like" me on facebook!

A+ FlashCards currently #6 Free Education app


Confidence is contagious. So is lack of confidence.
-- Vince Lombardi
cye is offline   Reply With Quote
Old 09-21-2010, 10:44 AM   #12 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 8
pakmee is on a distinguished road
Default legalility

Quote:
Originally Posted by cye View Post
use
textView.inputView = myCustomKeyboard;
Anyone knows if using the hidden class uikeyboard is legal?
pakmee is offline   Reply With Quote
Old 09-21-2010, 07:58 PM   #13 (permalink)
cye
14 Year Old App Developer
 
Join Date: Mar 2010
Location: Texas
Posts: 242
cye is on a distinguished road
Default

Quote:
Originally Posted by pakmee View Post
Anyone knows if using the hidden class uikeyboard is legal?
its not hidden
i have an app in the app store using it
__________________
14 year old app developer!

Type Faster and More Accurately With Easy Typing

"Like" me on facebook!

A+ FlashCards currently #6 Free Education app


Confidence is contagious. So is lack of confidence.
-- Vince Lombardi
cye is offline   Reply With Quote
Reply

Bookmarks

Tags
custom, keyboard, uikeyboard

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 314
15 members and 299 guests
chemistry, Domele, Fstuff, givensur, heshiming, HowEver, iAppDeveloper, iphonedevshani, jbro, JoeRCruso, kapps11, newDev, SLIC, stanny, WheyLabs
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,112
Posts: 402,874
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:26 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0