UIWebView in multithread ViewController

前端 未结 8 868
日久生厌
日久生厌 2020-12-24 09:38

I have a UIWebView in a viewcontroller, which has two methods as below. The question is if I pop out(tap back on navigation bar) this controller before the second thread is

8条回答
  •  我在风中等你
    2020-12-24 10:20

    - (void)dealloc
    {
        if(![NSThread isMainThread]) {
            [self performSelectorOnMainThread:@selector(dealloc) 
                                   withObject:nil 
                                waitUntilDone:[NSThread isMainThread]];
            return;
        } 
        [super dealloc];
    }
    

提交回复
热议问题