Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load a scene in a storyboard from a view controller
    text
    copied!<p>I am developing an application that loads a web page (using UIWebView) using Storyboard (I do know nothing about previous xib neither). I have already created a view controller for that UIWebView and everything works fine. The thing is: since previous versions of iOS don't allow to upload files, I need to make a new view (scene I thought it is called) that allows the user to pick and post a picture. I am able to develop both views separately and they work as expected but now I need to connect them based on event triggered when user wants to post a picture to the server. Using shouldStartLoadWithRequest I can catch that action, then I need to redirect to new view (which contains image picker and a button in order to upload the selected image) if iOS version is below 6.0 but I am really lost when it comes to load the new controller to show that view. Using buttons it is trivial but I don't know how to called inside the code. So far, I have a view controller linked to that scene and I have tried these ways:</p> <pre><code>WritePostViewController *postViewController = [[WritePostViewController alloc] init]; [self.navigationController pushViewController:postViewController animated:YES]; </code></pre> <p>And even calling the storybard: </p> <pre><code>UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; [sb instantiateInitialViewController]; UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"WritePostView"]; vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentViewController:vc animated:YES completion:NULL]; </code></pre> <p>The first approach does nothing and second one shows this error log:</p> <p><em>*</em> WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: Storyboard () doesn't contain a view controller with identifier 'WritePostView'*</p> <p>I have been browsing and reading a lot but nothing solves my problem. For sure this a problem with my not-so-large knowledge about iOS but I am really stuck. I will thank any help.</p> <p>By the way, I need to come back after posting the file but I could imagine it is the same way opposite direction, right?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload