Re: NSPredicateEditorRowTemplate and templateView delegates
Re: NSPredicateEditorRowTemplate and templateView delegates
- Subject: Re: NSPredicateEditorRowTemplate and templateView delegates
- From: Peter Ammon <email@hidden>
- Date: Mon, 28 Apr 2008 12:19:03 -0700
On Apr 28, 2008, at 8:12 AM, Jim Turner wrote:
I've a NSPredicateEditor with some basic popup-popup-view style
templates (where the view is a NSTextField). I am attempting to set
the text field's delegate to one of my objects so I can be notified
when the control text changes. Everything appears to be setup
correctly except my controlTextDidChange: never gets called. I'm
setting the delegate in my view controller's awakeFromNib: as such:
[snip code]
and 'self' does implement controlTextDidChange: I realize the
template gets copied when it's used by the editor and I wonder if the
delegate isn't getting copied as well. Is there a better way of
setting the delegate of a text field in a
NSPredicateEditorRowTemplate?
Hi Jim,
As you surmised, delegates are not propagated by copy.
NSPredicateEditor posts NSControlTextDidChangeNotification, with
itself as the notification object, whenever any of its text fields
changes. If you ask for the predicate editor's object value at that
point, it will reflect any edits in the text field. That's the
simplest way to get the filter-as-you-type behavior that I suspect you
want.
Let me know if that doesn't answer your question,
-Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden