I’m have a TextViewCell with a text field that that I’m using in a tableview. I need the current view controller to be the delegate. Nothing worked and in my searches I found the code below, which I implemented in my initWithNib method:
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(textDidEndEditing:) name:NSTextDidEndEditingNotification object:tableView];
But i’m getting the error NSTextDidEndEditingNotification Undeclared (first use in function)
Why am I getting that error? How do I fix that?
Thanks
The notification you’re using belongs to NSTextField, which belongs to Cocoa Touch’s big brother, the desktop Cocoa. What you want is UITextFieldTextDidEndEditingNotification which is the notification sent out by UITextField, the text control on the iPhone. The docs are here.
HTH.