Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Field editor delegate doesn't work



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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.