TextView结束编辑时发送的通知是什么?

时间:2012-11-22 11:47:47

标签: iphone objective-c xcode notifications uitextview

TextView结束编辑时发送的通知是什么?我试过了:

 - (void)TextViewDidEndEditing:(UITextView *)textView

但它不起作用。

3 个答案:

答案 0 :(得分:2)

此通知将被称为

- (BOOL)textViewShouldEndEditing:(UITextView *)textView

答案 1 :(得分:2)

通知是 UITextViewTextDidEndEditingNotification

在视图中尝试加载

NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];

    [defaultCenter addObserver:self
        selector:@selector(centerViewOnKeyboardDismissal:)
        name:UITextFieldTextDidEndEditingNotification object:nil];

更改方法名称

- (void)TextViewDidEndEditing:(UITextView *)textView 
to 
- (void)textViewDidEndEditing:(UITextView *)textView 

答案 2 :(得分:0)

TextView结束编辑时的委托方法是:

- (void)textViewDidEndEditing:(UITextView *)textView

您的代理人的问题是您使用大写字母开始了方法名称。这就是它无法正常工作的原因。

请参阅UITextViewDelegate_Protocol Reference