Reload webview from another class
I want to reload a webview from another class, i've set the property and synthesized it.
When i import the webview's class in the class i want to reload from,开发者_运维百科 and create the webview's class and do [class.property reload], it doesn't reload.
Update with code:
CustomerDetailViewController *custDetail = [[CustomerDetailViewController alloc] init];
[custDetail.webView reload];
Is your webview being created programmatically?
If so, it looks like you might be trying to reload the webview before it even exists?
If you are using a nib...
If your viewcontroller's view is the webview then:
[custDetail.view reload];
If your webview is a subview of the viewcontroller's view then:
[custDetail.view.webView reload];
精彩评论