views:

111

answers:

1

I have my CD store setup and everything is working. Once my initial fetch is performed, I need to perform several fetches based on calculations using the data from my first fetch. The examples provided from Apple are great, and helped me get everything going but I'm struggling with executing successive fetches. Any suggestions, or tutorial links are appreciated.

  1. Table View loads data from CD store.
  2. When a user taps a row it pushes a detail view
  3. The detail view loads details from CD. [THE ABOVE STEPS ARE ALL WORKING]
  4. I perform several calculations on the data fetched in the detail view.
  5. I need to then perform several other fetches based on the results of my calculations.
A: 

If your successive fetches are against the subset you already retrieved then you can narrow your searching by calling -filteredArrayUsingPredicate: upon the NSArray that is returned from the original fetch.

update

When you say several other fetches, are you wanting to fetch against the store or against the data you already have in memory?

If you need to fetch against the store, there is nothing stopping you from performing additional fetches by instantiating new NSFetchRequest objects.

If you are fetching against the data you already have in memory then my answer above applies.

Marcus S. Zarra
Marcus, thanks for your response. I revised my original question. Let me know what you think.
yesimarobot