• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView, resignFirstResponder and textShouldEndEditing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView, resignFirstResponder and textShouldEndEditing


  • Subject: NSTextView, resignFirstResponder and textShouldEndEditing
  • From: Aaron Tuller <email@hidden>
  • Date: Mon, 4 Aug 2003 02:17:58 -0700

sigh, I sent this a few hours ago, and of course I meant my textShouldEndEditing method wasn't being called, not textShouldChange. I only want to validate after the user leaves the text view, not right after the drag. sorry for the typo, here is what I meant to write:

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 textShouldEndEditing: 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 textShouldEndEditing: 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.
_______________________________________________
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.
  • Prev by Date: Re: [ObjC newbie]: dereferencing pointer to incomplete type
  • Next by Date: break, continue, goto
  • Previous by thread: Re: Detecting Screensaver
  • Next by thread: break, continue, goto
  • Index(es):
    • Date
    • Thread