I am building an application targeting iOS 3.1.3 and later, and I am having a problem with UIKeyboardBoundsUserInfoKey . It turns out that it is deprecated in iOS 3.2 and later. I used the following code to use the right key depending on the version of iOS:
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 great, but Xcode warns me that UIKeyboardBoundsUserInfoKey deprecated. How can I get rid of this warning without having to suppress any other warnings?
Also, is there a way to simply check if a UIKeyboardBoundsUserInfoKey exists to avoid having to check the iOS version? I tried to check if it was NULL or nil and even a weak UIKit link, but nothing works.
Thanks in advance
source share