0

Possible Duplicate:
UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?

I have the following code with an issue which I would love to remove:

NSDictionary* info = [notif userInfo];
NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];  
CGSize keyboardSize = [aValue CGRectValue].size;

On the second line of the code I get the message "UIKeyboardBoundsUserInfoKey is deprecated". I,ve read similar error messages on the forum and tried a few things but my newby mind can not fix it.

Community
  • 1
  • 1
  • See http://stackoverflow.com/questions/2807339/uikeyboardboundsuserinfokey-is-deprecated-what-to-use-instead – Sam Dufel May 23 '11 at 05:55

3 Answers3

1

You should check out the docs anytime something is marked as deprecated. You will usually find info about what has replaced the deprecated item. In this case, the Keyboard Notification User Info Keys section of the UIWindow reference:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html

Use UIKeyboardFrameBeginUserInfoKey and UIKeyboardFrameEndUserInfoKey instead of UIKeyboardBoundsUserInfoKey

kball
  • 4,923
  • 3
  • 29
  • 31
0

You can use UIKeyboardFrameEndUserInfoKey instead of UIKeyboardBoundsUserInfoKey.

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
PgmFreek
  • 6,374
  • 3
  • 36
  • 47
0

it means that DONT USE UIKeyBoundsUserInfoKey. because it is not present anymore in the new iOS xcode... so try to use the later or different key..i.e look at this tutorial http://www.w3bookmarks.com/mobile-application-development-tutorial/iphone-questions-uikeyboardboundsuserinfokey-is-deprecated-what-to-use-instead/

Izac Mac
  • 491
  • 3
  • 20