MosheBerman/MBCalendarKit

Single date in multiple events reload

kumawatankur opened this issue · 3 comments

I am using a MB Calendar. That time single date in single event show. But I want single date on multiple events show. But how it possible please help.

   - (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;

 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];
}
   

 }

I am still waiting for your response. I am so tired please help .

I assume this isn't relevant anymore, but for anyone who happens to look at this, you want to put multiple events in the array:

self.data[date1] = @[event1, /* event2, event3, etc. */];

Closing because this is really old.