我将 MBCalendar Kit 导入到我的项目中,但我不知道如何在日历中添加事件或事件数组。我找到了这段代码:
NSMutableDictionary *eventsDict = [[NSMutableDictionary alloc] init];
for (int i =0; i< eventsArray.count ;i++)
{
// Create events
eventsDict = eventsArray[i];
CKCalendarEvent* aCKCalendarEvent = [[CKCalendarEvent alloc] init];
aCKCalendarEvent.title = [eventsDict objectForKey:@"email"];
aCKCalendarEvent.date = date; //[eventsArray objectForKey:@"phone"];
aCKCalendarEvent.address = [eventsDict objectForKey:@"addrLine1"];
aCKCalendarEvent.image = [eventsDict objectForKey:@"pPic"];
aCKCalendarEvent.name = [eventsDict objectForKey:@"fname"];
aCKCalendarEvent.appDate = [eventsDict objectForKey:@"apntDt"];
aCKCalendarEvent.notes = [eventsDict objectForKey:@"notes"];
aCKCalendarEvent.phone = [eventsDict objectForKey:@"phone"];
[myeventsArray addObject: aCKCalendarEvent];
}
[_data setObject:myeventsArray forKey:date];
但我不知道在哪里写它,或者如何使用它。谁能帮我?谢谢你。