Learning Core Data + best practices, question

Question

I've trying to learn Core Data. The API is somewhat complicated and there's so many opinions on the best practices.

I read this blog post http://martiancraft.com/blog/2015/03/core-data-stack/ and tried to use the same core data setup. But I have one question:

The author of the blog post above has "completeUserInterface" method in app delegate that is called when CD stack is ready. What do you guys suggest I should do in that method?

I used that "completeUserInterface" method to injected managed object context to root view controller. The problem its that table view in my root view wants to use Fetched Results Controller before the view controller receives the managed object context -> crash: 'An instance of NSFetchedResultsController requires a non-nil fetchRequest and managedObjectContext'

So should I put some code for my view controller that is used in every table view delegate and datasource methods that check that if managed object context is nil -> then don't try to use fetched results controller? Or how should I make use of that "completeUserInterface" handler?

Posted Nov 9, 2015, 8:24 PM UTC

02
Loading comments…