I am new to objective C, coming from .NET and java background.
So I need to create some UIwebviews asynchronously, I am doing this on my own queue using
dispatch_queue_t queue = dispatch_queue_create("myqueue", NULL);
dispatch_async(queue, ^{
// create UIwebview, other things too
[self.view addSubview:webView];
});
as you owuld imagine this throws an error :
bool _WebTryThreadLock(bool), 0xa1b8d70: Tried to obtain the web lock from a thread other
than the main thread or the web thread. This may be a result of calling to UIKit from a
secondary thread. Crashing now...
So how can I add the subview on the main thread?