gpt4 book ai didi

ios - 在 ios 中为 MBCalendar Kit 添加事件

转载 作者:行者123 更新时间:2023-11-28 22:32:27 25 4
gpt4 key购买 nike

在我的应用中,我使用的是 MBCalendar Kit

我从MBCalendar from CocoaControl得到了源代码.

但是我怎样才能添加一个新的事件来显示在 tableview 中呢?

最佳答案

 -(void)addEvents:(NSArray *)eventsArray forDate:(NSDate*)date
{
NSMutableArray *myeventsArray = [[NSMutableArray alloc] init];

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];
NSLog(@"data %@",_data);


}

你可以这样添加事件

关于ios - 在 ios 中为 MBCalendar Kit 添加事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17017681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com