Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
Skipping day when leaving out NSOperationQueue code
posted

Hello,

I didn't want to reply on my other post since I don't really know if this is related. You mentioned to me before that I don't need to use the NSOperationQueue when using AFNetworking since it's just for simulating an async effect on your sample. When I remove the NSOperationQueue and go to a DayView I have the following issue:

First you scroll down in a day and you swipe to the left to move to the previous day, a day is skipped and in some cases multiple days are skipped.

This made me add the following code around the whole request provideAppointments code:

[[NSOperationQueue mainQueue] addOperation: [NSBlockOperation blockOperationWithBlock:^(void)
{

        [request provideAppointments:appts];
}]];

@Steve: This issue I can easily reproduce in the sample you sent yesterday.

  • 40030
    Verified Answer
    Offline posted

    Hey Daan, 

    Sorry for the confusion. 

    I just meant to remove the Async NSBlock Operations, you still need to make sure that the provideAppoitnments method is called on the main thread. So, if you're callback occurs outside of the main thread, then you need to make sure you notify the calendar on the main thread. 

    -SteveZ