views:

249

answers:

1

Although there is sample code in the ADC for parent/child (one to many rather than inheritance) core data, the child relationship is managed by simply loading all of the related objects into a set, and then into an array. The application I have in mind may have huge amounts of related data per parent object, therefore I would like to use NSFetchedResultsController on the child side. My attempts to do this have worked other than the controllerDidChangeContent delegate callback. With one fetched results controller on the master tableviewcontroller and another on the many side, and aFetchedResultsController.delegate = self; the delegate callbacks were fired against random objects - errors returned from invalid selector 'controllerDidChangeContent:' on things like the toolbar and sqllite whenever the underlying data was updated.

Can anyone suggest working sample code of how to use NSFetchedResultsController in both parent and child parts of a relationship.

A: 

You definitely can implement an app with several table views in which each table view has a table view controller as its datasource/delegate and each table view controller has its own fetched results controller (that may fetch objects of different entities and/or with different filter predicates and/or with different sort descriptor(s)).

It would be hard to give you specific recommendations without knowing more about what your are doing (with code examples) and the specific issue(s) that you are having.

gerry3
Thanks Gerry. I've moved onto using an array on the "many" side but I know it will run into memory issues with large datasets. I'll revert back to the original attempt and post some code here.
Andiih
mine were fetching objects from the same entity. Controlling what delegates were set better, and finding the right predicate has got me a long way forward! Thx for your encouragement.
Andiih
Good point about the same entity. I have clarified my answer.
gerry3