Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

CalEvent Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/CalendarStore.framework
Availability
Available in Mac OS X v10.5 and later.
Companion guide
Declared in
CalEvent.h

Overview

A CalEvent object represents an event added to a calendar in iCal.

Use the event method to create a new event or use the CalCalendarStore eventsWithPredicate: method to fetch existing events. This method takes an NSPredicate object as the argument so you can build your own queries. Use the CalCalendarStore eventPredicateWithStartDate:endDate:calendars: method to create an NSPredicate object for common queries that you can pass to the eventsWithPredicate: method.

Use the properties in this class to get information about an event. For example, the attendees property is an array of CalAttendee objects representing the people who are invited to this event. The attendees property is read-only. Use the startDate and endDate properties to access the start and end date and time for an event.

If you retain event objects, you can observe the CalEventsChangedNotification notification to update event objects when they change. Event objects can be added, changed, or deleted locally and externally after you fetch them.

Tasks

Creating Events

Getting Properties

Properties

For more about Objective-C properties, see “Properties” in The Objective-C 2.0 Programming Language.

attendees

An array of invited guests or an empty array if there are no attendees. This property is read-only.

@property(readonly) NSArray *attendees

Availability
Declared In
CalEvent.h

endDate

The end date and time for this event.

@property(copy) NSDate *endDate

Discussion

An error occurs if you attempt to save an event whose start date occurs after the end date.

Availability
Declared In
CalEvent.h

isAllDay

YES if this is an all day event; otherwise, NO.

@property BOOL isAllDay

Availability
Declared In
CalEvent.h

isDetached

Returns whether or not an event is detached. This property is read-only.

@property(readonly) BOOL isDetached

Availability
Declared In
CalEvent.h

location

A description of the location of this event.

@property(copy) NSString *location

Availability
Declared In
CalEvent.h

occurrence

The occurrence date of an event. This property is read-only.

@property(readonly) NSDate *occurrence

Availability
Declared In
CalEvent.h

recurrenceRule

The recurrence rule of an event.

@property(copy) CalRecurrenceRule *recurrenceRule

Availability
Declared In
CalEvent.h

startDate

The start date and time for this event.

@property(copy) NSDate *startDate

Discussion

An error occurs if you attempt to save an event whose start date occurs after the end date.

Availability
Declared In
CalEvent.h

Class Methods

event

Creates and returns a newly allocated CalEvent object.

+ (id)event

Discussion

Use the saveEvent:span:error: method to save a new event to the iCal database.

Availability
See Also
Declared In
CalEvent.h

Next Page > Hide TOC


Last updated: 2007-07-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice