atomikpanda
atomikpanda

Reputation: 1886

UITextView did end editing

I would like to NSLog something when my UITextView is done editing.

I've tried

- (BOOL)textViewShouldEndEditing:(UITextView *)textView

and

- (void)textViewDidEndEditing:(UITextView *)textView

neither worked.

fix:

myTextView.delegate = self;

Upvotes: 4

Views: 16103

Answers (2)

Zeezer
Zeezer

Reputation: 1533

If you are using UITextField instead make sure to use UITextFieldDelegate and not UITextViewDelegate. And this method instead, that fixed my problems.

- (void)textFieldDidEndEditing:(UITextField *)textField

Upvotes: 2

LianYong Lee
LianYong Lee

Reputation: 321

do you set the delegate of your textview?

fix:

set delegate in .h file like this:

#import <UIKit/UIKit.h>  

@interface TextViewController : UIViewController <UITextViewDelegate>  
{  
          UITextView *textView;  
}  
@property (nonatomic, retain) UITextView *textView;  
@end 

Upvotes: 10

Related Questions