I strongly suggest you read Core Data Programming Guide and start with Core Data Basics Chapter.
UIManagedDocument
is a special kind of document, an UIDocument
subclass, that stores its data using Core Data Framework. So it combines the power of document architecture and core data capabilities.
You can read more about document based architecture from Document Based App Programming Guide for iOS and I recommend WWDC2011 Storing Documents in iCloud using iOS5 session video. I also recommend Stanford CS193P: iPad and iPhone App Development (Fall 2011) Lecture 13.
What is created when you call saveToURL:forSaveOperation:completionHandler:
is an implementation detail of UIManagedDocument
and UIDocument
and you should not really worry or depend on it. However in current implementation a folder containing an sqlite database file is being created.
No. All entities will be contained in a single database file also
more generally called: a persistent store. It is possible to use
more than one persistent store, but those are more advanced use
cases and UIManagedDocument
currently uses one.
UIManagedDocument
's context refers to a NSManagedObjectContext
from underlying Core Data Framework. UIManagedDocument
actually operates two of those in parallel to spin off IO operations to a background thread. When it comes to the nature of a context itself here's a quote from Core Data Programming Guide:
You can think of a managed object context as an intelligent scratch
pad. When you fetch objects from a persistent store, you bring
temporary copies onto the scratch pad where they form an object graph
(or a collection of object graphs). You can then modify those objects
however you like. Unless you actually save those changes, however, the
persistent store remains unaltered.
But it really is a good idea to take a look at the lectures and other material I posted above to get a general picture of the technologies used and their potential value to you as a developer in different situations.