Hello,

I use NSSearchFields bound to NSArrayControllers to allow my client to search their Core Data database. Pretty standard. My search predicate bindings are lengthy, giving my client lots of options to find what they want.

Occasionally I would like to programmatically specify a search for them. For example, I was able to programmatically clear their search fields like this:

    [searchfield setStringValue: @""];
    [arrayController setFilterPredicate: nil];

However I can't work out how to set the correct non-nil predicate. Actually, I don't want to set the predicate -- that's already done nicely in the bindings and I don't want to duplicate it in the code, for maintenance reasons. ** I just want to put something in the search field and make it 'do it' **

I've tried increasingly desperate ideas to 'do' the search string. Here is my most recent defeat - sad, perhaps comical:

    [searchfield setStringValue: @"10471"];
[arrayController setFilterPredicate: [arrayController filterPredicate]]; // :)

(How) can I just trigger the search after setting the NSSearchField's value?

Thanks,

Steve

_______________________________________________

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