Hi, I have searched and read so many pages, but even though tried so many different codes, I couldn't get it working. Here is the situation:
I have a tabcontroller which its first tab has a view and inside the view there is a UIWebView. Normally when a push notification comes for the app and when user clicks to View button, when app is loading, I parse the the push msg and on ViewController, I rediret the UIWebView to proper page.
But when the push comes inside the app and when user clicks the View button, I needed to call the ViewController function from AppDelegate to redirect UIWebView to proper page. Somehow I got rid of the errors, but now it is doing nothing. Here are the codes:
MainViewController.m
MyAppDelegate.h
MyAppDelegate.m
I have a tabcontroller which its first tab has a view and inside the view there is a UIWebView. Normally when a push notification comes for the app and when user clicks to View button, when app is loading, I parse the the push msg and on ViewController, I rediret the UIWebView to proper page.
But when the push comes inside the app and when user clicks the View button, I needed to call the ViewController function from AppDelegate to redirect UIWebView to proper page. Somehow I got rid of the errors, but now it is doing nothing. Here are the codes:
MainViewController.m
Code:
- (void) gotoProperPage {
NSString *gameURL = [@"http://game.com?game?id="stringByAppendingString:appDelegate.gameID];
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:gameURL]]];
}
MyAppDelegate.h
Code:
@class MainViewController;
@interface MyAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
MainViewController *mvc;
}
@property (nonatomic, retain) IBOutlet MainViewController *mvc;
MyAppDelegate.m
Code:
#import "MainViewController.h"
@implementation MSLiteAppDelegate
@synthesize mvc;
...
- (void) someMethod{
[mvc gotoProperPage];
}
...