Hello,
First, thanks for the SR and the quick support so far, i'm still having issues with the fact asyncAppointmentRequest is not called in many of my cases. I'm trying to reproduce these issues in the samples project so I can send the code.
There are a few other things I wanted to point out, there will be more as soon as I got it reproduced in the samples browser:
Moderate: When I set the delegate to igCalendarAppointmentDatasourceProtocolAsync and add the dayChanged, weekChanged, monthChanged and yearChanged methods with logging I notice the weekChanged is being called many times while year and month (have not checked the day view yet)
2015-12-11 11:05:39.386 SamplesBrowser[346:38334] yearChanged
2015-12-11 11:05:41.905 SamplesBrowser[346:38334] monthChanged
2015-12-11 11:05:43.746 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.750 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.758 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.760 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.782 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.786 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.804 SamplesBrowser[346:38334] weekChanged
2015-12-11 11:05:43.811 SamplesBrowser[346:38334] weekChanged
Minor: When I start the Appt Datasource Async on an iPad with iOS 9.0.2 building with XCode 7.1.1 I get the following trace as soon as the calendar loads:
2015-12-11 10:44:16.806 SamplesBrowser[326:33845] *** -[__NSCFCalendar dateByAddingComponents:toDate:options:]: date cannot be nil
Future exception.
A few of these errors are going to be reported with this complaint, then further violations will simply be ignored.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):
(
0 CoreFoundation 0x000000018632e7bc <redacted> + 252
1 CoreFoundation 0x000000018632e644 <redacted> + 96
2 SamplesBrowser 0x000000010018b034 __57-[igCalendarAppointmentDatasourceProtocolAsync loadAppts]_block_invoke + 1176
3 Foundation 0x000000018730f82c <redacted> + 16
4 Foundation 0x00000001872626c0 <redacted> + 96
5 Foundation 0x0000000187252918 <redacted> + 604
6 Foundation 0x0000000187311c20 <redacted> + 224
7 libdispatch.dylib 0x0000000100a89d30 _dispatch_client_callout + 16
8 libdispatch.dylib 0x0000000100a967f0 _dispatch_queue_drain + 1036
9 libdispatch.dylib 0x0000000100a8da20 _dispatch_queue_invoke + 464
10 libdispatch.dylib 0x0000000100a98908 _dispatch_root_queue_drain + 760
11 libdispatch.dylib 0x0000000100a98600 _dispatch_worker_thread3 + 132
12 libsystem_pthread.dylib 0x000000019b6c9478 _pthread_wqthread + 1092
13 libsystem_pthread.dylib 0x000000019b6c9028 start_wqthread + 4
)
Major issue: I am able to reproduce my issue not seeing appointments in the samples browser.
What I have done is added the code from igCalendarAppointmentDatasourceProtocolAsync to igCalendarNavigation so that I can have a good navigational test. All seemed okay and everything was visible but when I add the following line of code at the end of viewDidLoad the appointments are not displayed for that week (when I go to month and back to the same week I still get no appointments:
[_cal navigateToDate:[NSDate date] forType:IGCalendarViewDisplayTypeWeek];
The reason I add this line is that I want to have the calendar initially in week view on the iPad.
I added the class as an attachment :-)
Hey Daan,
Thanks for the sample.
The Calendar is actually working correctly. However, when the WeekView request the appointments, there aren't any appointments available yet.
Thats b/c in the sample, the appointments from the CSV are being loaded in a background thread.
So when the calendar asks for appointments for that specific point in time, there are no appointments available.
If you don't load the CSV in the background, then it works fine. Or you could call invalidate after the appointments are loaded and reloaded the calendar view.
Hope this helps,
-SteveZ
Thanks for the reply,
I have removed all the NSOperation code and it still works. The invalidate I still need to display the initial data in the week view. This is probably because of another bug I mentioned before: In the week view the asyncAppointmentRequest is called too many times.
Let me try to explain my theory:
The first asyncAppointmentRequest adds the current month to the months array but it is not the current week call. While this call is getting data from the web service the second asyncAppointmentRequest is called with the correct week which is displayed. At this moment the web service call has not finished and the appointments array is empty. If you could fix the issue where the asyncAppointmentRequest is called too many times that would fix my issue and then I can remove the invalidate call from the request.
Yes, so if too many requests are occurring, the current request object you had, would no longer be valid, and thus you would run into the issue. So, yea that makes sense.
Problem is, I don't see that happening.
You should see 2 requests when a particular View loads. One for the current week/month/day and one for the next week/month/day.
Then when you scroll, you should see one additional request, as the calendar always keeps 2 date ranges in scope.
I've attached my sample. if you could run it, could you let me know if you see what i'm seeing or if your still seeing multiple requests.
Thanks,
Steve,
I see this is only the following method that is called many times but I guess that's no issue:
-(void)calendarView:(IGCalendarView *)calView weekChanged:(NSDate *)date
I've added some logging in the asyncAppointmentRequest and notice the two calls are done duplicate and that explains the no data displayed initially.
Here is the logging:
2015-12-14 17:37:08.631 Gensys[10110:299696] Start of async request
2015-12-14 17:37:08.632 Gensys[10110:299696] request.start == 2015-12-12 23:00:00 +0000
2015-12-14 17:37:08.632 Gensys[10110:299696] request.end == 2015-12-20 22:59:59 +0000
2015-12-14 17:37:08.632 Gensys[10110:299696] Month doesn't exist
NOW THE WEB SERVICE CALL IS DONE
2015-12-14 17:37:08.633 Gensys[10110:299696] Start of async request
2015-12-14 17:37:08.634 Gensys[10110:299696] request.start == 2015-12-19 23:00:00 +0000
2015-12-14 17:37:08.634 Gensys[10110:299696] request.end == 2015-12-27 22:59:59 +0000
2015-12-14 17:37:08.634 Gensys[10110:299696] Month exists
2015-12-14 17:37:08.663 Gensys[10110:299696] Start of async request
2015-12-14 17:37:08.664 Gensys[10110:299696] request.start == 2015-12-12 23:00:00 +0000
2015-12-14 17:37:08.664 Gensys[10110:299696] request.end == 2015-12-20 22:59:59 +0000
2015-12-14 17:37:08.664 Gensys[10110:299696] Month exists
2015-12-14 17:37:08.670 Gensys[10110:299696] Start of async request
2015-12-14 17:37:08.670 Gensys[10110:299696] request.start == 2015-12-19 23:00:00 +0000
2015-12-14 17:37:08.670 Gensys[10110:299696] request.end == 2015-12-27 22:59:59 +0000
2015-12-14 17:37:08.670 Gensys[10110:299696] Month exists
NOW THE DATA COMES BACK FROM THE WEB SERVICE
I can't put my finger on why the call is duplicate. When I scroll horizontally to other weeks I still don't see any data. I disabled most other code and still no fix.
Hmm..
So to be clear, my sample was working for you, right?
If so, that means we're at least seeing the same thing there. So the question is, whats different in your actual application versus my sample?
The only thing that should trigger another appointment request call, would be calling invalidate somewhere on the calendar?
Can you take a look at your code, and make sure you're not doing that somewhere else in your code?
Yes the sample is working. I have been debugging and debugging last couple of hours. I added two screenshots in the attachment, both are executed twice, the first twice and then after that the second twice. It's not the selectedIndex on the tabbarcontroller cause I already called the CalendarViewController as a simple presentviewcontroller on another button and it gives me something else but is still called four times.
There is also the CalendarViewController header and implementation files. I truly have no idea what's going wrong or what i'm doing different than in your example besides using AFNetworking to retrieve the data.
Just wanted to tell that the support so far has always been great at Infragistics :-)
Ok, so its definitely using the same build.
Maybe you can try using Sync callback with your simplified sample, and see if thats getting called 4 times?
2015-12-16 08:38:09.239 Gensys[28167:1603930] 2015.2.103
Perhaps the projects are using different versions of the IG Framework?
Can you insert the following line of code, in both the sample application, and in your actual app?
NSLog(@"%@", [IGBuildVersion buildVersion]);
I just want to make sure that your application isn't holding on to an older version.
I see the sample and everything working fine there. The only other difference I see is that you are using a storyboard where as we're using seperate xib files for the user interface.
I'm running out of ideas and without the CalendarView source code there is no way I can debug the issue. As you saw I stripped the entire code and do a simple call to the UIViewController. Nothing special just like in your sample.
Therefore I also checked the project settings and made some changes there. Also no result.
Thanks for the stripped down version.
I tried it out, and cleaned out all the commented code, but its still not happening for me.
I've attached the sample. Can you verify your'e seeing the same thing?