I building an app targeting iOS 3.1.3 and later and I've run into a problem with UIKeyboardBoundsUserInfoKey. Turns out it is deprecated in iOS 3.2 and later. What I did was use the following code to use the right key depending on the iOS version:
if ([[[UIDevice currentDevice] systemVersion] compare:@"3.2" options:NSNumericSearch] != NSOrderedAscending)
[[aNotification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardBounds];
else [[aNotification.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue: &keyboardBounds];
And this actually works fine, but Xcode warns me that UIKeyboardBoundsUserInfoKey is deprecated. How can I get rid of this warning without having to suppressing any other warnings?
Also, is there a way to simply check if UIKeyboardBoundsUserInfoKey is defined to avoid having to check the iOS version? I tried checking if it was NULL or nil and even weaklinking UIKit but nothing seemd to work.
Thanks in advance