Block main thread until UIWebView finishes loading
问题 I'm trying to block the main thread until a UIWebView finishes loading, but calling [NSThread sleepForTimeInterval:] after calling [UIWebView loadRequest:] makes the loading never complete: The webViewDidFinishLoad delegate is called after the sleep finishes. Why is this happening? and How can I block the main thread? I'm calling loadPage from [ViewController willRotateToInterfaceOrientation:] , what I'm trying to do is to prevent the iOS interface to rotate until the webview with the other