Question

There are two ways to get a NSManagedObjectContext that I know of:

  1. create a UIManagedDocument and ask for its managed object context

  2. access the AppDelegate's managedObjectContext @property.

What are the trade-offs here? I've been doing it the UIManagedDocument way, but I can't seem to find an explanation anywhere on when/why you'd choose one over the other. Any clarification would be greatly appreciated!

Was it helpful?

Solution

Use UIManagedDocument if you're arranging data in a manner that the user perceives as a "document"'s worth of data. If you are not, then you could use UIManagedDocument or the AppDelegate mechanism interchangeably.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top