liebus

Tried to obtain the web lock from a thread other than the main thread or the web thread 본문

예전꺼(2014년이전꺼)/Mac

Tried to obtain the web lock from a thread other than the main thread or the web thread

리베스 2017. 3. 20. 11:08


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.   라는 메세지를 토해내면서 죽어 버리는 어플리케이션



쫄지 말자 해당내용을 보면 쓰레드 충돌로 인한 것임을 알 수 있다 







본 필자의 경우 로그인 뷰(네이티브) 로그인후 처리 뷰(웹뷰) 형태 이다 


해당 메세지가 로그인후 웹뷰를 로딩하는 과정에서 발생 했다. 


창을 닫아주는 과정과 웹뷰를 로딩하는 과정에서 문제가 발생 


해서 해당 부분을 메인쓰레드 에서 처리 하도록 변경 해서 처리 했다. 



dispatch_async(dispatch_get_main_queue(), ^{

   // 여기에 처리해야할 내용

});







Comments