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
  •  | 
  •  

Pergunta

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top