Hi,
Steps to reproduce crash on calendar view.
- Change appointment duration as more than one day (for e.g in appts.csv file, last column change it to 3000)
- Run app & then click on date in month view for that multiple appointment , app is crashing.
Please find below partial crash log,
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 96 beyond bounds [0 .. 95]'
*** First throw call stack:
(
0 CoreFoundation 0x0332e5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02c258b6 objc_exception_throw + 44
2 CoreFoundation 0x032cf556 -[__NSArrayM objectAtIndex:] + 246
3 CoreFoundation 0x033ad608 -[NSArray objectAtIndexedSubscript:] + 40
4 SamplesBrowser 0x001f02ae -[DayViewArea updateLayout] + 1149
5 SamplesBrowser 0x001f205e -[DayViewArea setDay:withAppointments:force:] + 288
6 SamplesBrowser 0x001f5535 -[MultiDayViewArea render:] + 1120
7 SamplesBrowser 0x001f4116 -[MultiDayViewArea request:appointmentsProvided:] + 722
8 SamplesBrowser 0x002060a5 -[IGCalendarAppointmentRequest provideAppointments:] + 102
9 SamplesBrowser 0x0011d35a __92-[igCalendarAppointmentDatasourceProtocolAsync calendarView:asyncAppointmentRequest:ofType:]_block_invoke_2 + 122
10 Foundation 0x02467b85 -[NSBlockOperation main] + 88
11 Foundation 0x024c0a69 -[__NSOperationInternal _start:] + 671
I couldn't reproduce the error, although i think it was a problem originally in the SamplesBrowser. Basically we weren't building the dates properly. Below you can find the latest version of the method we're using to load the CSV:
-(void)loadAppts
{
[[[NSOperationQueue alloc]init] addOperation:[NSBlockOperation blockOperationWithBlock:^(void)
NSString* filepath = [[NSBundle mainBundle] pathForResource:@"appts" ofType:@"csv"];
NSError *err;
NSString *dataRaw = [NSString stringWithContentsOfFile:filepath encoding:NSASCIIStringEncoding error:&err];
NSArray *linesArray = [dataRaw componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@",\r"]];
NSMutableArray* appts = [[NSMutableArray alloc]init];
for(int i = 0; i < linesArray.count; i+=4)
NSMutableDictionary* appt = [[NSMutableDictionary alloc]init];
appt[@"location"] = linesArray[i + 1];
appt[@"title"] = linesArray[i + 2];
NSString* dateString = linesArray[i];
float duration = ((NSString*)linesArray[i + 3]).floatValue;
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"MM.dd.yy HH:mm"];
NSDate* date;
[df getObjectValue:&date forString:dateString range:nil error:nil];
NSDateComponents* comps = [[NSDateComponents alloc]init];
comps.minute = duration;
NSCalendar* cal = [NSCalendar currentCalendar];
NSDate* endDate = [cal dateByAddingComponents:comps toDate:date options:0];
appt[@"start"] = date;
appt[@"end"]= endDate;
[appts addObject:appt];
}
[[NSOperationQueue mainQueue] addOperation: [NSBlockOperation blockOperationWithBlock:^(void)
_appts = [NSArray arrayWithArray:appts];
}]];
-SteveZ
Still getting crash on selection of date.
I think it is relation to this other post I responded to:
http://ko.infragistics.com/community/forums/t/87014.aspx
Hi
I have downloaded latest code from site & have done changes in appts.csv file as mentioned above.
Still I am getting crash on clicking the date & future date dont have any appointment listed in it.
Your early reply is really appreciable to us for finalising the product.
Regards
Ameer
Hello,
This has been addressed in the latest service release. To download the service release, log in to ‘Account’ and select ‘Keys & Downloads’. Select the appropriate tab for this product; then the license key. The available service releases (Hot Fixes) should now be listed on the page. Let me know if you have any questions regarding this matter.
Let us know if you have any questions regarding this matter.
Michael,
I'm using the Xamarin version of the controls. Will these be updated at the same time, or will it be a separate release?
Thanks!
Hello Brandon,
I have opened a private case for you as well so this way you will be notified automatically when the development issue is updated. The case number is CAS-134176-Q0S7N6. You will see it located here: https://ko.infragistics.com/my-account/support-activity
Let me know if you have any questions regarding this matter.
Steve,
I'm also encountering the same error in production and need this fix ASAP. Would you mind adding me to the release notification so that I can get this patch in? Also, do you have any estimate on the timeline for the next release?
Thank you for your help!
-Brandon
Thanks for your patience Ameer,
I was able to reproduce the issue now, and have identified a bug within the DayView.
I already have a fix in place for it, our Support team will notify you of the bug number so that you'll be notified when the next SR is realeasd.
Thanks again