tworzenie widoku na wątku w tle, dodawanie go do głównego widoku wątku głównego
Jestem nowy w zakresie C, pochodzącym z .NET i tła java.
Więc muszę utworzyć asynchronicznie niektóre UIwebviews, robię to na własnej kolejce za pomocą
dispatch_queue_t queue = dispatch_queue_create("myqueue", NULL);
dispatch_async(queue, ^{
// create UIwebview, other things too
[self.view addSubview:webView];
});
jak wyobrażasz sobie, to rzuca błąd:
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...
Jak więc mogę dodać widok podrzędny do wątku głównego?