NSTextView, resignFirstResponder and textShouldChange
NSTextView, resignFirstResponder and textShouldChange
- Subject: NSTextView, resignFirstResponder and textShouldChange
- From: Aaron Tuller <email@hidden>
- Date: Sun, 3 Aug 2003 23:29:37 -0700
I think I'm missing something here, I have a subclass of NSTextView
to accept a custom type (a vCard). Works great. However, I have a
delegate attached to my view and I validate the text in a
textShouldChange: method in the delegate. This works great when the
text is typed in but when I setString: in my
readSelectionFromPasteboard:type: method it doesn't mark the text as
being edited so my delegate method never gets called when it loses
first responder. I even explicitly do this around my setString: call:
[[self window] makeFirstResponder:self];
[self setString:stringBuilder];
[self didChangeText];
[[self window] makeFirstResponder:nil];
and still my textShouldChange: doesn't get called. Am I doing
something wrong? I couldn't find anything that seemed to tell the
text view that it has been edited other than didChangeText. I
verified that the TextView subclass is getting a
"resignFirstResponder" call so should I completely override it and
call my delegate explicitly?
Thanks for the help.
-aaron
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.