0
votes

In an iOS 8.4.1 Cocoa Touch application, I have code like this:

dispatch_after( dispatch_time( ...), dispatch_get_main_queue(), block);

and I was surprised to observe that 'block' is running on a thread other than the main thread. My previous understanding was that the use of dispatch_get_main_queue() in this context guaranteed that block would run on the main thread. Apple documentation states that for the main queue, "tasks execute serially on your application's main thread", so I don't understand how this behavior is consistent with the documentation. Can someone explain this behavior, or point me to some documentation which does? Thank you.

1

1 Answers

0
votes

Duh, never mind, it was on the main thread after all. I was fooled by looking at some recorded stack frames on another thread.