How to pass a plist string (html file name) via table view to detailviewcontroller's webview?

StackOverflow https://stackoverflow.com/questions/18247245

  •  24-06-2022
  •  | 
  •  

Domanda

È stato utile?

Soluzione

Create a property in your detailViewController, in my case it's webViewController.

@property (nonatomic, strong) NSString *urlString;

When your tableView cell is clicked, pass your plist string to your detailViewController, by setting this property. Sample code:

  WebViewController *webViewController = [WebViewController new];
  webViewController.urlString = urlString;
  [self.navigationController pushViewController:webViewController animated:YES];

That's all, now your detailViewController knows this passed string.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top