Domanda

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!

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top