Post

Replies

Boosts

Views

Activity

Modal view on main queue on iOS
Hello. I`m trying to display modal view on iOS something like this: -(void) showModal { … dispatch_async( dispatch_get_main_queue(), ^{ … [window makeKeyAndVisible];} ); while( !dataReady_ ) /* Wait till user stops work with modal view*/ { CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0.2, FALSE ); } /* Closing modal view and go to exit */ } It’s worked fine not so long ago on any queue (doesn’t matter main or secondary). But on new devices, iPhone 13 and higher on iOS 16.x it doesn’t works on main queue. View doesn’t not displayed and CFRunLoopRunInMode always returns 3 (kCFRunLoopRunTimedOut). On main queue, the modal view isn’t displayed until the showModal function is complited. But showModal cannot be complited because the CFRunLoopRunInMode loop waits until the modal view stop working. On old devices, iPhone XR on iOS 16.x, it’s still works fine on any queue. It’s seems problem depends of hardware but not depends of operation system version. Probably I’m do something wrong? Can I force UI event handler on main queue before completion the showModal function? On old devices CFRunLoopRunInMode helps, but now not.
0
0
412
Apr ’23
NSProgressIndicator on modal window from secondary thread in Big Sur
Hello, I have a determinated NSProgressIndicator located on modal window (runModalForWindow or beginModalSessionForWindow). I run it on a secondary thread using dispatch_get_main_queue. On Mojave It works correctly. On Big Sur I see a strange behavior: the progress bar moves only once and don't move after that. In debug, I can see that doubleValue is changes normally. All others controls on this window seems run correctly. When I run this in ordinary window (makeKeyAndOrderFront) or initially running in main queue, everything works correctly.   Thus, the problem always occurs in Big Sur, only with determinated NSProgressIndicator located on modal window, running in non-UI thread. What I do wrong? Is it correct to run modal window from non UI thread?
3
0
700
Feb ’21