diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-02-20 16:49:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-04 15:59:05 +0100 |
commit | 903953d69e490392031f7d04b2fbe96a0a17ac95 (patch) | |
tree | 28d0629ea3eebdf1ce95688ad312cd14c8fa515f /src/plugins/platforms/ios | |
parent | d32a80dbee061a4842fcc3bd2a0208d521af4d9d (diff) |
iOS: prevent crash on iOS 5
For some reason, the [] access into NSDictionary causes
a crash on iOS 5. So instead use the API as listed in
the documentation: objectForKey.
Task-number: QTBUG-36532
Change-Id: I19fdf0f4ba1aebaf9477e2bd45040c389923605d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiosinputcontext.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index d426028c46..4fe2cae15e 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -120,7 +120,7 @@ // For Qt applications we rotate the keyboard rect to align with the screen // orientation (which is the interface orientation of the root view controller). // For hybrid apps we follow native behavior, and return the rect unmodified: - CGRect keyboardFrame = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect keyboardFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; if (isQtApplication()) { UIView *view = m_viewController.view; return fromCGRect(CGRectOffset([view convertRect:keyboardFrame fromView:view.window], 0, -view.bounds.origin.y)); @@ -156,8 +156,8 @@ m_keyboardVisibleAndDocked = YES; m_keyboardEndRect = [self getKeyboardRect:notification]; if (!m_duration) { - m_duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - m_curve = UIViewAnimationCurve([notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16); + m_duration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; + m_curve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16); } m_context->scrollToCursor(); } |