So I have a situation here where I'm creating UIWebViews and adding them to an array to later be used in a tableview. I had to do it this way for 2 reasons, one to be able to calculate the height of each row correctly, and two to be able to scroll the tableview without having the webviews slowing it down because they were still loading the content. So now I just create all 15 in advance and then when they're done loading I reload the table.
Anyway, this has led to the app freezing while the webviews are being created and loading. I figured that I should just run this method in it's own thread with NSThread or NSOperations, but whenever I do that I get the message that:
So. How would I handle this? Loading the webviews lazily isn't an option here, but having the app freeze while they're loading isn't very desirable either. Is there really no way to run this in another thread?
Anyway, this has led to the app freezing while the webviews are being created and loading. I figured that I should just run this method in it's own thread with NSThread or NSOperations, but whenever I do that I get the message that:
bool _WebTryThreadLock(bool), 0x393aae0: 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...
So. How would I handle this? Loading the webviews lazily isn't an option here, but having the app freeze while they're loading isn't very desirable either. Is there really no way to run this in another thread?