Reputation: 9012
I have a UIWebView
object declared in my view controller and I want to make it load a different page when the app recieves a notification while the app is running using application:didRecieveRemoteNotification:
. I'm having trouble accessing the object from inside the appDelegate.
Any simple way to do this?
this is how I declare my web view
IBOutlet UIWebView *webView;
@property (nonatomic, retain) UIWebView *webView;
@synthisize webView;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:currentPath]]];
Upvotes: 0
Views: 355
Reputation: 16719
this is not the best idea to show the web view from outside the controller. Just add method like this to controller:
-(void) loadFromPath:(NSString*) path {
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath: path]]];
}
and call it in your app delegate when you need.
Upvotes: 2