Ios 键盘上的UITextview委托崩溃未显示通知
我在类Y中使用UITextView,并且在X中添加了类Y作为子视图。 现在,当在UIKeyboardDidShowNotification上发送通知的UItextview中开始编辑时,当它发送通知时,需要完成两项任务 1.将整个视图向上移动P个单位 2.键盘动画是自动进行的 这是我正在做的代码 注:-NewTagDesc是一个UIViewIos 键盘上的UITextview委托崩溃未显示通知,ios,delegates,crash,notifications,Ios,Delegates,Crash,Notifications,我在类Y中使用UITextView,并且在X中添加了类Y作为子视图。 现在,当在UIKeyboardDidShowNotification上发送通知的UItextview中开始编辑时,当它发送通知时,需要完成两项任务 1.将整个视图向上移动P个单位 2.键盘动画是自动进行的 这是我正在做的代码 注:-NewTagDesc是一个UIView @protocol TagDescDelegate; @interface NewTagDesc : UIView <UITextViewDeleg
@protocol TagDescDelegate;
@interface NewTagDesc : UIView <UITextViewDelegate>
{
__unsafe_unretained id <TagDescDelegate> delegate;
}
@property (nonatomic, unsafe_unretained) id <TagDescDelegate> delegate;
//it crashes here, if you touch desc too freq. says its calling this method and this class is deallocated
-(void) noticeShowKeyboard:(NSNotification *)inNotification {
if ([delegate respondsToSelector:@selector(editingDescStarted:)]) {
[delegate editingDescStarted:self];
}
keyboardVisible = YES;
}
-(void) noticeHideKeyboard:(NSNotification *)inNotification {
if ([delegate respondsToSelector:@selector(editingDescEnded:)]) {
[delegate editingDescEnded:self];
}
keyboardVisible = NO;
}
@protocol-TagDescDelegate;
@接口NewTagDesc:UIView
{
__不安全的\u未保留的id代表;
}
@属性(非原子的、不安全的、未维护的)id委托;
//它在这里崩溃,如果你点击desc too freq。表示它调用这个方法,这个类被释放
-(无效)通知显示键盘:(NSNotification*)创新{
if([delegate respondsToSelector:@selector(EditingDescented:)])){
[委托编辑开始:自我];
}
键盘可见=是;
}
-(void)noticeHideKeyboard:(NSNotification*)创新{
if([delegate respondsToSelector:@selector(EditingDowned:)])){
[代理编辑下降:自我];
}
键盘可见=否;
}
现在,当notificaion被触发时,我的应用程序崩溃。表示其已分配,并注意显示键盘名为…:O。。。。。我直觉认为错误可能与委托的使用方式或通知有关。有人能帮忙吗。。。。很久以来我一直在研究这个问题您能从xcode控制台发布崩溃日志吗?以及您订阅通知的方式?[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(noticeShowKeyboard:)name:UIKeyboardDidShowNotification对象:nil];[[NSNotificationCenter defaultCenter]添加观察者:自选择器:@selector(noticeHideKeyboard:)名称:UIKeyboardWillHideNotification对象:nil];当然我将重新生成并粘贴崩溃日志…我想你是谁?只是为了确认:)它在这里崩溃了-[NewTagDesc noticeShowKeyboard:]:消息已发送到解除分配的实例0x1f4a3b40。。。现在有什么线索吗。。。。