Exception while calling another screen in IOS <p>I am new in IOS developing. In <code>Main.storyoard</code>, I added a new <code>viewcontroller</code>, assigned it to a new class <code>LoginViewController</code> and provided a storyboard-ID <code>loginview</code>. In the <code>LoginViewController</code> class, after successful login I tried the following code to call the default viewcontroller having storyboard-ID <code>webview</code>.</p> <pre><code>NSString *storyboardName = @"Main"; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil]; UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"webview"]; [self presentViewController:vc animated:YES completion:nil]; </code></pre> <p>During debugging I got the following exception </p> <blockquote> <p>2016-05-04 18:37:11.020 gcmexample[2690:86862] bool _WebTryThreadLock(bool), 0x7fa5d3f3d840: 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... 1 0x11328d34b WebThreadLock 2 0x10e5547dd -[UIWebView _webViewCommonInitWithWebView:scalesPageToFit:] 3 0x10e555179 -[UIWebView initWithCoder:] 4 0x10e7b5822 UINibDecoderDecodeObjectForValue 5 0x10e7b5558 -[UINibDecoder decodeObjectForKey:] 6 0x10e5e1483 -[UIRuntimeConnection initWithCoder:] 7 0x10e7b5822 UINibDecoderDecodeObjectForValue 8<br> 0x10e7b59e3 UINibDecoderDecodeObjectForValue 9 0x10e7b5558 -[UINibDecoder decodeObjectForKey:] 10 0x10e5e06c3 -[UINib instantiateWithOwner:options:] 11 0x10e3b9eea -[UIViewController _loadViewFromNibNamed:bundle:] 12 0x10e3ba816 -[UIViewController loadView] 13 0x10e3bab74 -[UIViewController loadViewIfRequired] 14 0x10e3bb2e7 -[UIViewController view] 15 0x10eb65f87 -[_UIFullscreenPresentationController _setPresentedViewController:] 16 0x10e38af62 -[UIPresentationController initWithPresentedViewController:presentingViewController:] 17 0x10e3cdc8c -[UIViewController _presentViewController:withAnimationController:completion:] 18 0x10e3d0f2c -[UIViewController _performCoordinatedPresentOrDismiss:animated:] 19 0x10e3d0a3b -[UIViewController presentViewController:animated:completion:] 20 0x10d065eed <strong>34-[LoginViewController btnSign_in:]_block_invoke 21 0x10fd3f6b5 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke 22 0x10fd51a02 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke 23 0x10d1dc304 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK</strong> 24 0x10d118035 -[NSBlockOperation main] 25 0x10d0faf8a -[__NSOperationInternal _start:] 26 0x10d0fab9b __NSOQSchedule_f 27 0x11057f49b _dispatch_client_callout 28 0x1105658ec _dispatch_queue_drain 29 0x110564e0d _dispatch_queue_invoke 30 0x110567a56 _dispatch_root_queue_drain 31 0x1105674c5 _dispatch_worker_thread3</p> </blockquote> <p>Does anyone know whats the error here? Please help.</p>