- [TPKeyboardAvoidingScrollView keyboardWillHide:]:消息发送到ios中的deallocated实例?

时间:2014-04-08 05:11:53

标签: ipad

在我的xcode项目中导入TPKeyboardAvoidingScrollView.h和.m文件,并在我项目的所有类中使用TPkeyboard作为UIScrollview

 TPKeyboardAvoidingScrollView *scrollView = [[TPKeyboardAvoidingScrollView alloc] init];

该应用正在终止并显示错误

-[TPKeyboardAvoidingScrollView keyboardWillHide:]: message sent to deallocated
instance.

任何人都可以向我提供一些信息。

提前致谢。   TPKeyboardAvoidingScrollView.m 中的KeyboardWillHide功能:

- (void)keyboardWillHide:(NSNotification*)notification {
    _keyboardRect = CGRectZero;
    _keyboardVisible = NO;

    // Restore dimensions to prior size
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]];
    [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]];

    self.contentInset = _priorInset;
    self.contentOffset = CGPointMake(self.contentOffset.x, 0);
    [self setScrollIndicatorInsets:self.contentInset];
    _priorInsetSaved = NO;
    [UIView commitAnimations];

}

0 个答案:

没有答案