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
I tried both solutions posted above, [operationQueue cancelAllOperations]
, and [[self retain] autorelease]
. However, with quick clicking, there are still cases where the retain count falls to 0 and the class gets deallocated on the secondary thread. In order to avoid a crash, I put the following in my dealloc
for now:
if ([NSThread isMainThread]) {
[super dealloc];
}
which is an obvious leak, but seems to be the lesser of 2 evils.
Any additional insight from anyone encountering this problem is welcome.