私は .NET と Java のバックグラウンドから来て、Objective C を初めて使用します。
だから私はいくつかのUIwebviewsを非同期的に作成する必要があります.私は自分のキューでこれを行っています
dispatch_queue_t queue = dispatch_queue_create("myqueue", NULL);
dispatch_async(queue, ^{
// create UIwebview, other things too
[self.view addSubview:webView];
});
ご想像のとおり、これはエラーをスローします:
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...
では、メインスレッドにサブビューを追加するにはどうすればよいですか?