質問

Can you update the UI from a beginBackgroundTaskWithExpirationHandler ? Is it possible to do so using a perofrmSelectorOnMainThread or GCD ?

役に立ちましたか?

解決

Are you trying to update the UI from the expiration handler? Because that's where you should be doing this (as it marks the end of the task) and not only can you update the UI but you are SUPPOSED to update the UI from there. To quote the Apple docs:

The handler is called synchronously on the main thread, blocking the app’s suspension momentarily while the app is notified.

Seems pretty clear cut to me.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top