我有一個應用程序以編程方式創建日曆事件,它正在工作,我只是讓它檢索用戶日曆並在拾取器中顯示它們,但我有內存泄漏。你可以看到它,因爲我試圖釋放一切......另外我的主要問題是如何保存到用戶選擇的日曆,[事件setCalendar:calendararray];不起作用。 calendararray是一個EKCalendar * calendararray,我將用戶選定的日曆設置爲它。爲什麼這不起作用?我如何使它工作...查找iOS日曆
日曆.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);
好吧,告訴我如何得到某處,我發現代碼顯示它在日誌中,但我環顧四周,找不到如何將其轉換爲字符串我發佈了上面的代碼。感謝所有的幫助。 – BDGapps 2011-05-30 03:05:08