On Sep 21, 2016, at 09:20 , Dave <d...@looktowindward.com> wrote:
> The time consuming method I am calling is in a third party library and it
> must be called in the main thread.
You cannot update UI on a background thread, so if the library method is
blocking the main thread you’re out of luck. The only solution is to get the
library author to write proper code.
If the library method is running on the main thread and calling back to a block
of your code (which sounds like the case), then it’s safe execute code that
issues UI updates, but you likely won’t see the results until later, after your
app returns to the main event loop.
If a time-consuming operation *is* running on a background thread, it can
dispatch_async a block to the main thread to update the UI, but then you must
consider thread safety, if the update is referencing data that’s still being
modified as the background thread continues to run.
Cocoa-dev mailing list (Cocoafirstname.lastname@example.org)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to arch...@mail-archive.com