I have an issue that looks like a race condition with a webview callback and a location manager callback that interact with the same variables and an alert dialog – the dialog is created in the location callback and should be dismissed in the webview callback. I thought that the delegate callbacks for standard objects like the webview and core location would be run in the main thread – is that not correct?
Share
If in doubt then you can do something like this:
To make sure that you are always executing callback methods on the main thread and thus preventing concurrency issues.
You can also use a
@synchronizedblock of course, but in my experience it is much better to rely on the synchronous nature of executing methods on the main thread.