Instance Method

commit:

Commits all unsaved changes to the event store.

Declaration

- (BOOL)commit:(NSError * _Nullable *)error;

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, YES; otherwise, NO. Returns YES 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 NO as the commit parameter to the saveCalendar:commit:error:, removeCalendar:commit:error:, saveEvent:span:commit:error:, or removeEvent:span:commit:error: methods, the changes are not saved until this method is invoked. Likewise, if you pass YES as the commit parameter to the aforementioned methods, there is no need to call this method.

See Also

Saving and Restoring State

- reset

Returns the event store to its saved state.

- refreshSourcesIfNecessary

Pulls new data from remote sources if necessary.