Mailing Lists: Apple Mailing Lists

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

Subclassed NSArray, and using predicates and NSArrayController



Hi,

I'm subclassing NSArray to abstract it against a remote data source, specifically a MySQL table. The only issue I have is that instead of evaluating predicates locally on the machine, I want to evaluate the predicate remotely through MySQL. I have pretty decent predicate->SQL statement support going right now, and I can correctly execute a SQL statement and return row objects.

My only issue is with NSArrayController's predicate. Does NSArrayController attempt to evaluate the predicate internally by pulling rows from the NSArray one by one? Or does it defer to NSArray's filteredArrayUsingPredicate:? If the NSArrayController attempts to evaluate the predicate internally, this could be a problem for me because it's going to pull every row from the server and evaluate it locally. If it defers to NSArray's filteredArrayUsingPredicate:, it will hit my subclassed filterArrayUsingPredicate:, which will evaluate the predicate as a SQL statement on the server, not pegging the server.

I'm trying to put together a test program, but am having some issues getting the predicate that is bound to the NSArrayController to even work with my NSArray subclass (so far it doesn't seem to be filtering at all), so I thought I'd ask the list for input.

Thanks, Colin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden


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.