Posts

Post not yet marked as solved
9 Replies
1.8k Views
Hello,After updating to Xcode 10 I started having an issue where the app freezes when waiting for a semaphore. I tried changing to dispatch groups but the same thing happens: it works normally with Xcode 10 and freezes with Xcode 11 (both stable and beta).The code is basically this:result = falsedispatch_semaphore_t semaphore = dispatch_semaphore_create(0);dispatch_sync(dispatch_get_main_queue(), myBlock);dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);return result;Inside myBlock I display an AlertView that signals the semaphore when the uses presses either button.Simply changing to dispatch_async stops the freezing, but also breaks the functionality since I need the answer from the AlertView before returning.
Posted Last updated
.