iOS Guides | Samples

MonoTouch.CoreData.NSManagedObjectContext Class

A collection of related managed objects that create aninternally-consistent view of one or more persistent stores.

See Also: NSManagedObjectContext

Syntax

[MonoTouch.Foundation.Register("NSManagedObjectContext", true)]
public class NSManagedObjectContext : NSObject, INSCoding, INSLocking, IDisposable

Related content

Requirements

Namespace: MonoTouch.CoreData
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.CoreData.NSManagedObjectContext are listed below.

See Also: NSObject

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
Creates a new NSManagedObjectContext of the specified type.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AutomaticallyMergesChangesFromParentBoolean. Gets or sets a Boolean that tells whether changes in the parent are automatically merged.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
[read-only]
ConcurrencyTypeNSManagedObjectContextConcurrencyType. Gets the receiver's concurrency type.
[read-only]
DeletedObjectsNSSet. Gets a set that contains the objects that will be deleted by the next save operation.
[read-only]
static
DidSaveNotificationNSString. Notification constant for DidSave
[read-only]
HasChangesBoolean. Gets a Boolean value that tells whether the receiver has any unsaved changes.
[read-only]
InsertedObjectsNSSet. Gets the inserted, but unsaved, objects in the context.
MergePolicyIntPtr. Gets or sets the receiver's merge policy.
NameString. Gets or sets a name for the object.
[read-only]
static
ObjectsDidChangeNotificationNSString. Notification constant for ObjectsDidChange
ParentContextNSManagedObjectContext. Gets the receiver's parent context.
PersistentStoreCoordinatorNSPersistentStoreCoordinator. Gets the receiver's store coordinator.
PropagatesDeletesAtEndOfEventBoolean. Gets or sets a Boolean value that controls whether the receiver propagates deletes after change events.
[read-only]
QueryGenerationTokenNSQueryGenerationToken. Gets the token that identifes the current query generation behavior.
[read-only]
RegisteredObjectsNSSet. Gets a set that contains all of the receiver's registered objects.
RetainsRegisteredObjectsBoolean. Gets or sets a Boolean value that controls whether the receiver retains hard references to its registered managed objects.
ShouldDeleteInaccessibleFaultsBoolean. Gets or sets a Boolean value that controls whether inaccessible faults wil be deleted.
StalenessIntervalDouble. Gets or sets the maximum elapsed time after fetching which causes fault fulfillment to fetch new data.
[read-only]
TryLockBoolean.
UndoManagerNSUndoManager. Gets the receiver's undo manager.
[read-only]
UpdatedObjectsNSSet. Gets a set that contains all of the receiver's objects which have uncommitted changes.
[read-only]
UserInfoNSMutableDictionary. Gets the receiver's user information.
[read-only]
static
WillSaveNotificationNSString. Notification constant for WillSave

Public Methods

AssignObject(IntPtr, NSPersistentStore)
Assigns object1 to store.
CountForFetchRequest(NSFetchRequest, out NSError) : UInt32
Returns the number of objects that request would return if it were run.
DeleteObject(NSManagedObject)
Queues object1 for deletion.
DetectConflictsForObject(NSManagedObject)
Marks object1 for conflict detection.
ExecuteFetchRequest(NSFetchRequest, out NSError) : NSObject[]
Runs the specified request.
ExecuteRequest(NSPersistentStoreRequest, out NSError) : NSPersistentStoreResult
Runs the specified request.
GetExistingObject(NSManagedObjectID, out NSError) : NSManagedObject
Fetches an object with a specified id.
InsertObject(NSManagedObject)
Inserts object1 into the context.
Lock()
MergeChangesFromContextDidSaveNotification(NSNotification)
Method that is called to merge the changes that are specified by notifictaion.
static
MergeChangesFromRemoteContextSave(NSDictionary, NSManagedObjectContext[])
Merges remote changes.
ObjectRegisteredForID(NSManagedObjectID) : NSManagedObject
Returns the object that is identified by objectID, if it represents a registered object.
ObjectWithID(NSManagedObjectID) : NSManagedObject
Returns the object that is identified by objectID
ObserveValueForKeyPath(String, IntPtr, NSDictionary, IntPtr)
Observes the object that is identified by the provided object and keypath for changes.
ObtainPermanentIDsForObjects(NSManagedObject[], out NSError) : Boolean
Converts the objec identifiers to permanent identifiers for the provided objects. Returns true if all of the identifiers were converted.
Perform(NSAction)
Asynchronously performs the specified action.
PerformAndWait(NSAction)
Send a message to the object, use if you created the object with PrivateQueue or MainQueue concurrency types.
ProcessPendingChanges()
Tells the receiver to process all changes on the object graph.
Redo()
Reverses the most recent unreversed undo.
RefreshAllObjects()
Refreshes all objects in the store.
RefreshObject(NSManagedObject, Boolean)
Refreshes object1 with the most current values from its store.
Reset()
Resets the receiver.
Rollback()
Rolls the state of all objects in the object graph back to the most recent committed values.
Save(out NSError) : Boolean
Saves uncommitted changes and reports any error that it encounters.
SetQueryGenerationFromToken(NSQueryGenerationToken, out NSError) : Boolean
Sets the query generation from the specified query generation token.
ShouldHandleInaccessibleFault(NSManagedObject, NSManagedObjectID, NSPropertyDescription) : Boolean
Returns a Boolean value that controls whether inaccessible faults wil be handled.
Undo()
Instructs the receiver to undo its uncommitted changes.
Unlock()