我在我的项目中使用日历视图。我正在使用MBCalendarKit。那个时间在单场演出中的单次约会。但我想在多个活动节目中单独约会。但怎么可能请帮忙。
- (void) viewWillAppear: (BOOL)animated{
NSArray *title = [_caldevice valueForKey:@"pill"];
// NSLog(@"event name fetch %@",title);
NSArray *date =[_caldevice valueForKey:@"datetaken"];
// NSLog(@"event fetch %@",date);
NSArray*dose= [_caldevice valueForKey:@"dose"];
NSString *title1;
NSString*title2;
NSDate *date1;
NSData *imgdata;
CKCalendarEvent *releaseUpdatedCalendarKit;
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"dd-MM-yyyy";
for (int i = 0; i < [date count]; i++){
title1 = NSLocalizedString(title[i], @"");
title2 = NSLocalizedString(dose[i], @"");
NSString *combined = [NSString stringWithFormat:@"%@ - %@", title1, title2];
date1 = [dateFormatter dateFromString:date[i]];
releaseUpdatedCalendarKit = [CKCalendarEvent eventWithTitle:combined andDate:date1 andInfo:Nil];
// NSLog(@"Event: %@ , %@",combined,date1);
// releaseUpdatedCalendarKit = [CKCalendarEvent eventWithTitle:combined andDate:date1 andInfo:Nil andColor:[UIColor blueColor]];
self.data[date1] = @[releaseUpdatedCalendarKit];
}
}