• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclassed NSArray, and using predicates and NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassed NSArray, and using predicates and NSArrayController


  • Subject: Subclassed NSArray, and using predicates and NSArrayController
  • From: Colin Cornaby <email@hidden>
  • Date: Fri, 30 Mar 2007 11:43:03 -0700

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:
This email sent to email@hidden


  • Prev by Date: Re: Convience Methods and Collections
  • Next by Date: Re: Convience Methods and Collections
  • Previous by thread: Re: Core Data Memory issue on loading a saved file
  • Next by thread: Re: Subclassed NSArray, and using predicates and NSArrayController
  • Index(es):
    • Date
    • Thread