Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Why does SSManagedViewController needs mainQueueContext to init? #31

Closed
nitriques opened this issue Mar 23, 2014 · 2 comments
Closed

Why does SSManagedViewController needs mainQueueContext to init? #31

nitriques opened this issue Mar 23, 2014 · 2 comments

Comments

@nitriques
Copy link

I ran against this nasty bug in my app.

- (NSFetchedResultsController *)fetchedResultsController always returns nil.

If I removed the [SSManagedObject hasMainQueueContext] check here everything works fine and the mainQueueContext gets created when the fetchRequest gets created.

Any ideas why ? Should I just called [SSManagedObject mainQueueContext] in my app delegate ?

@soffes
Copy link
Owner

soffes commented Mar 24, 2014

This is intentional. If you are tearing down Core Data, your view controllers could touch a FRC and start up Core Data again. The desired way to get going is to reference mainQueusContext in application did finish launching.

I agree that this is a bit unexpected at first. I should document this a bit more.

Sam

On Mar 23, 2014, at 11:58 AM, Nicolas Brassard notifications@github.com wrote:

I ran against this nasty bug in my app.

  • (NSFetchedResultsController *)fetchedResultsController always returns nil.

If I removed the [SSManagedObject hasMainQueueContext] check here everything works fine and the mainQueueContext gets created when the fetchRequest gets created.

Any ideas why ? Should I just called [SSManagedObject mainQueueContext] in my app delegate ?


Reply to this email directly or view it on GitHub.

@nitriques
Copy link
Author

Ok thanks for the reply, I now know that my technique is not a hack and feel safer with it.

#22 will take care of documentation right ;) ? Thanks again for allowing others to build upon your work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants