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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to