Mac Developer Library

Developer

EventKit Framework Reference EKObject Class Reference

Options
Deployment Target:

On This Page
Language:

EKObject

Conforms To


Import Statement


Swift

import EventKit

Objective-C

@import EventKit;

Availability


Available in OS X v10.8 and later.

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.

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

    Declaration

    Swift

    func hasChanges() -> Bool

    Objective-C

    - (BOOL)hasChanges

    Return Value

    Returns YEStrue if there are uncommitted changes; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • Returns whether this object has ever been saved.

    Declaration

    Swift

    func isNew() -> Bool

    Objective-C

    - (BOOL)isNew

    Return Value

    Returns YEStrue if the object has not been saved; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • Merges changes to this object with the latest saved values.

    Declaration

    Swift

    func refresh() -> Bool

    Objective-C

    - (BOOL)refresh

    Return Value

    If the operation is successful, YEStrue; if the object was deleted in the event store, NOfalse. If this method returns NOfalse, 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.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • Returns this object to its saved state.

    Declaration

    Swift

    func reset()

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in OS X v10.8 and later.

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

    Declaration

    Swift

    func rollback()

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in OS X v10.8 and later.