Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>EDIT after code in the question :</strong></p> <p>In the <code>ViewController</code> replace your code by :</p> <pre><code>- (IBAction)requestButton:(id)sender { BRWebView *web = [self.storyboard instantiateViewControllerWithIdentifier:@"BRWebView"]; web.loadUrl = @"http://websitename.com"; [self presentViewController:web animated:YES completion:nil]; } </code></pre> <p>and in the <code>BRWebView.m</code> remove your code in <em>viewDidLoad</em> and add <em>viewWillAppear</em> :</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // URL Request Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:[NSURL URLWithString:_loadUrl]]; // Load the request in the UIWebView [_requestWebView loadRequest:requestObj]; } </code></pre> <p><strong>Old answer :</strong></p> <p>You need to pass your URL data with a property like this <em>(without navigation controller)</em> :</p> <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { // Get reference to the destination view controller ViewControllerB *viewControllerB = segue.destinationViewController; // Pass URL viewControllerB.webviewURL = @"http://myurl.com"; } } </code></pre> <p><em>with navigation controller :</em></p> <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { UINavigationController *navController = (UINavigationController *)segue.destinationViewController; ViewControllerB *viewControllerB = (ViewControllerB *)navController.topViewController; // Pass URL viewControllerB.webviewURL = @"http://myurl.com"; } } </code></pre> <p>On your <strong>second view .h</strong> :</p> <pre><code>@property (nonatomic, strong) NSString *webviewURL; </code></pre> <p><strong>second view .m</strong> :</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // URL Request Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:[NSURL URLWithString:_webviewURL]]; // Load the request in the UIWebView [self.webView loadRequest:requestObj]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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