Instance Method

commit()

Commits all unsaved changes to the event store.

Declaration

func commit() throws

Parameters

error

A pointer to an NSError object. You do not need to create an NSError object. The commit operation aborts after the first failure if you pass NULL.

Return Value

If the commit operation succeeded, true; otherwise, false. Returns true even when there are no changes to commit.

Discussion

This method allows you to save batched changes to the event store. For example, if you pass false as the commit parameter to the saveCalendar(_:commit:), removeCalendar(_:commit:), save(_:span:commit:), or remove(_:span:commit:) methods, the changes are not saved until this method is invoked. Likewise, if you pass true as the commit parameter to the aforementioned methods, there is no need to call this method.

See Also

Saving and Restoring State

func reset()

Returns the event store to its saved state.

func refreshSourcesIfNecessary()

Pulls new data from remote sources if necessary.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software