lundi 29 juin 2015

Complex fetch-request for NSFetchedResultsController


Here's a simplified look for my model:

  • Media has property 'status' that can be either 'Uploading' or 'Uploaded'.
  • User has property 'syncStatus' that be either 'NotSynced' or 'Synced'.
  • ObjectX is a 'linking' object between User and Media
  • User has to-many relationship to ObjectX
  • ObjectX has to-one relationship to Media

Is there any way to use NSFetchedResultsController to fetch all Users that are 'Synced' and whose all media are 'Uploaded'? It would have to update its content also when 'Media' status is changed so that new User should be fetched. I've heard NSFetchedResultsController doesn't work well with such complex fetch requests.

Model Graph


Aucun commentaire:

Enregistrer un commentaire