• 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 textShouldChange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Question about line breaks and file types
  • Next by Date: C char*'s and NSStrings
  • Previous by thread: Question about line breaks and file types
  • Next by thread: C char*'s and NSStrings
  • Index(es):
    • Date
    • Thread