EKCalendarItem Class Reference

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

Overview

The EKCalendarItem class is a an abstract superclass for calendar events and reminders. This class provides common properties and methods for accessing properties of calendar items such as the ability to set the calendar, title, and location as well as support for attaching notes, displaying attendees, setting multiple alarms, and specifying recurrence rules.

Tasks

Accessing Calendar Items

Accessing Calendar Item Properties

Attaching Notes

Displaying Attendees

Adding and Removing Alarms

Setting Recurrence Rules

Properties

alarms

The alarms associated with the calendar item, as an array of EKAlarm objects.

@property(nonatomic, copy) NSArray *alarms
Discussion

This property is nil if the calendar item has no alarms.

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

attendees

The attendees associated with the calendar item, as an array of EKParticipant objects. (read-only)

@property(nonatomic, readonly) NSArray *attendees
Discussion

This property is read-only; it is not possible to add attendees with Event Kit. This property is nil if the calendar item has no attendees.

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

calendar

The calendar for the calendar item.

@property(nonatomic, retain) EKCalendar *calendar
Availability
  • Available in iOS 5.0 and later.
Declared In
EKCalendarItem.h

calendarItemExternalIdentifier

The calendar item’s external identifier as provided by the calendar server. (read-only)

@property(nonatomic, readonly) NSString *calendarItemExternalIdentifier
Discussion

This identifier allows you to access the same event or reminder across multiple devices.

There are some cases where duplicate copies of a calendar item can exist in the same database:

  • A calendar item was imported from an ICS file into multiple calendars

  • An event was created in a calendar shared with the user and the user was also invited to the event

  • The user is a delegate of a calendar that also has this event

  • A subscribed calendar was added to multiple accounts

In such cases, you should choose between calendar items based on other factors, such as the calendar or source.

Recurring event identifiers are the same for all occurrences. If you wish to differentiate between occurrences, you may want to use the start date.

For Exchange servers, the identifier is different between iOS and OS X and different between devices for reminders.

Availability
  • Available in iOS 6.0 and later.
Declared In
EKCalendarItem.h

calendarItemIdentifier

The calendar item’s unique identifier. (read-only)

@property(nonatomic, readonly) NSString *calendarItemIdentifier
Discussion

This property is set when the calendar item is created and can be used as a local identifier. Use calendarItemWithIdentifier: to look up the item by this value.

A full sync with the calendar will lose this identifier. You should have a plan for dealing with a calendar whose identifier is no longer fetch-able by caching its other properties.

Availability
  • Available in iOS 6.0 and later.
Declared In
EKCalendarItem.h

creationDate

The date that this calendar item was created. (read-only)

@property(nonatomic, readonly) NSDate *creationDate
Discussion

If nil, this property was not set or was synced in this state.

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

hasAlarms

A Boolean value that indicates whether the calendar item has alarms. (read-only)

@property(nonatomic, readonly) BOOL hasAlarms
Discussion

If YES, the calendar item has alarms; otherwise it does not.

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

hasAttendees

A Boolean value that indicates whether the calendar item has attendees. (read-only)

@property(nonatomic, readonly) BOOL hasAttendees
Discussion

If YES, the calendar item has attendees; otherwise it does not.

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

hasNotes

A Boolean value that indicates whether the calendar item has notes. (read-only)

@property(nonatomic, readonly) BOOL hasNotes
Discussion

If YES, the calendar item has notes; otherwise it does not.

Availability
  • Available in iOS 5.0 and later.
See Also
Declared In
EKCalendarItem.h

hasRecurrenceRules

A Boolean value that indicates whether the calendar item has recurrence rules. (read-only)

@property(nonatomic, readonly) BOOL hasRecurrenceRules
Discussion

If YES, the calendar item has recurrence rules; otherwise it does not.

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

lastModifiedDate

The date that the calendar item was last modified. (read-only)

@property(nonatomic, readonly) NSDate *lastModifiedDate
Availability
  • Available in iOS 5.0 and later.
Declared In
EKCalendarItem.h

location

The location associated with the calendar item.

@property(nonatomic, copy) NSString *location
Discussion

This property is nil if the calendar item has no location.

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

notes

The notes associated with the calendar item.

@property(nonatomic, copy) NSString *notes
Availability
  • Available in iOS 5.0 and later.
See Also
Declared In
EKCalendarItem.h

recurrenceRules

The recurrence rules for the calendar item.

@property(nonatomic, copy) NSArray *recurrenceRules
Availability
  • Available in iOS 5.0 and later.
Declared In
EKCalendarItem.h

timeZone

The time zone for the calendar item.

@property(nonatomic, copy) NSTimeZone *timeZone
Discussion

If nil, the calendar item is a floating event. A floating event is not tied to a particular time zone. It occurs at a given time regardless of the time zone — for example, “lunch at noon.” The start and end times of a floating event should be set as if they were in the system time zone.

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

title

The title for the calendar item.

@property(nonatomic, copy) NSString *title
Availability
  • Available in iOS 5.0 and later.
Declared In
EKCalendarItem.h

URL

The URL for the calendar item.

@property(nonatomic, copy) NSURL *URL
Availability
  • Available in iOS 5.0 and later.
Declared In
EKCalendarItem.h

Instance Methods

addAlarm:

Adds an alarm to the receiver.

- (void)addAlarm:(EKAlarm *)alarm
Parameters
alarm

The alarm to be added.

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

addRecurrenceRule:

Adds a recurrence rule to the recurrence rule array.

- (void)addRecurrenceRule:(EKRecurrenceRule *)rule
Parameters
rule

The rule to be added to recurrenceRules.

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

removeAlarm:

Removes an alarm from the calendar item.

- (void)removeAlarm:(EKAlarm *)alarm
Parameters
alarm

The alarm to be removed.

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

removeRecurrenceRule:

Removes a recurrence rule from the recurrence rule array.

- (void)removeRecurrenceRule:(EKRecurrenceRule *)rule
Parameters
rule

The rule to be removed from recurrenceRules.

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