【发布时间】:2011-09-04 08:59:52
【问题描述】:
我有一个以编程方式创建日历事件的应用程序,它正在运行,我只是做了它,以便它检索用户日历并将它们显示在选择器中,但我有内存泄漏。你能看到它,因为我尝试释放所有东西......此外,我的主要问题是如何将它保存到用户选择的日历中,[event setCalendar:calendararray];不起作用。 calendararray 是一个 EKCalendar *calendararray,我将用户选择的日历设置为它。为什么这不起作用????我如何使它工作...
日历.m
#import "calendar.h"
@implementation calendar
@synthesize delegate;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
EKEventStore *eventStore = [[EKEventStore alloc] init];
/* These are the calendar types an iOS Device can have. Please note
that the "type" property of an object of type EKCalendar
is of type EKCalendarType. The values in the "CalendarTypes"
array reflect the exact same values in the EKCalendarType
enumeration, but as NSString values */
NSArray *calendarTypes = [NSArray arrayWithObjects:
@"Local",
@"CalDAV",
@"Exchange",
@"Subscription",
@"Birthday",
nil];
/* Go through the calendars one by one */
NSUInteger counter = 1;
for (EKCalendar *thisCalendar in eventStore.calendars){
/* The title of the calendar */
NSLog(@"Calendar %lu Title = %@",
(unsigned long)counter, thisCalendar.title);
【问题讨论】:
标签: iphone objective-c xcode ipad ios4