EKObject Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/EventKit.framework
Availability
Available in iOS 5.0 and later.
Declared in
EKObject.h

Overview

The EKObject class is an abstract superclass for all Event Kit classes whose instances are persistent. It provides fine control when saving and restoring property settings. For example, you can find out if a persistent object was modified locally and whether it needs to be saved. If the object has changed in the event store since it was fetched, you can refresh the local copy by keeping local changes or by removing local changes. You can also roll back the object to the state when it was first fetched.

Tasks

Saving and Restoring State

Instance Methods

hasChanges

Returns whether this object or any of the objects it contains has uncommitted changes.

- (BOOL)hasChanges
Return Value

Returns YES if there are uncommitted changes; otherwise, NO.

Availability
  • Available in iOS 5.0 and later.
Declared In
EKObject.h

isNew

Returns whether this object has ever been saved.

- (BOOL)isNew
Return Value

Returns YES if the object has not been saved; otherwise, NO.

Availability
  • Available in iOS 5.0 and later.
Declared In
EKObject.h

refresh

Merges changes to this object with the latest saved values.

- (BOOL)refresh
Return Value

If the operation is successful, YES; if the object was deleted in the event store, NO. If this method returns NO, the object should be released.

Discussion

This method merges the local changes to properties of this object with the latest values in the event store. This method updates only properties that have not been modified locally, so you do not lose any changes by invoking this method. You can also use this method to see whether an object was deleted from the event store.

Availability
  • Available in iOS 5.0 and later.
Declared In
EKObject.h

reset

Returns this object to its saved state.

- (void)reset
Discussion

This method updates all the properties of this object with the corresponding values in the event store. Any local changes that were not saved before invoking this method are lost. This method does nothing if the object was never saved.

Availability
  • Available in iOS 5.0 and later.
Declared In
EKObject.h

rollback

Rolls back the property values of this object to its original state when it was first fetched.

- (void)rollback
Discussion

Any local changes to this object are lost when invoking this method. This method does not refetch property values from the event store. This method does nothing if the object was never changed.

Availability
  • Available in iOS 5.0 and later.
Declared In
EKObject.h