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
  •  | 
  •  
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top