• 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
Field editor delegate doesn't work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Field editor delegate doesn't work


  • Subject: Field editor delegate doesn't work
  • From: Sailor Quasar <email@hidden>
  • Date: Mon, 7 Jul 2003 22:44:51 -0400

I have an NSTextField in an NSWindow (natch :). In the window controller's awakeFromNib: method, I call [[window fieldEditor:YES forObject:textField] setDelegate:self]. I then in that same controller have an implementaion of -textView:shouldChangeTextInRange:replacementString:. The method is never called. I've verified this by placing an NSLog() at the top of the method, and I get nothing. How can I intercept key events relevant to the NSTextField in my window? Aside, of course, from my current horrible hack that subclasses NSApplication and overrides -sendEvent: to intercept NSKeyDown events and pass them on manually... I know, I could have just subclassed NSWindow's -sendEvent:, but at the time I hadn't done enough research into the event system to quite realize that :). In either case, I'd rather avoid subclassing altogether by using the delegate method. Modularity! Why require support from an NSApplication or NSWindow subclass to do something that can be done in window controller without even subclassing NSTextField?

-- Sailor Quasar, just another player in The World
"Come with me in the twilight of the summer night for awhile"
Email: email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: Field editor delegate doesn't work
      • From: Daryn <email@hidden>
    • Re: Field editor delegate doesn't work
      • From: publiclook <email@hidden>
  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Field editor delegate doesn't work
  • Previous by thread: Re: ScreenSaver cleanup
  • Next by thread: Re: Field editor delegate doesn't work
  • Index(es):
    • Date
    • Thread