在我的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];
}