UIWebView in multithread ViewController

前端 未结 8 881
日久生厌
日久生厌 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:14

    In general, you should cancel any background operations when the view that uses them is going away. As in:

    - (void)viewWillDisappear:(BOOL)animated {
      [operationQueue cancelAllOperations];
      [super viewWillDisappear:animated;
    }
    

提交回复
热议问题