Skip to content

Commit

Permalink
Update ExampleAppDelegate for new jsBridge interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
psineur committed Oct 27, 2011
1 parent eddeba4 commit 016d7b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WebViewJavascriptBridge/ExampleAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
webView = [[UIWebView alloc] initWithFrame:self.window.bounds];
[self.window addSubview:webView];

javascriptBridge = [WebViewJavascriptBridge createWithDelegate:self];
javascriptBridge = [WebViewJavascriptBridge javascriptBridgeWithDelegate:self];
webView.delegate = javascriptBridge;

[javascriptBridge sendMessage:@"HI"];
[javascriptBridge sendMessage:@"HI" toWebView: webView];

[self loadExamplePage];

[javascriptBridge sendMessage:@"HI2"];
[javascriptBridge sendMessage:@"HI2" toWebView: webView];

return YES;
}

- (void) handleMessage:(NSString *)message {
- (void) handleMessage:(NSString *)message fromWebView:(UIWebView *)theWebView {
NSLog(@"ExampleWebViewJavascriptBridgeDelegate received message: %@", message);
}

Expand Down Expand Up @@ -54,7 +54,7 @@ - (void) loadExamplePage {
}

- (void)applicationWillResignActive:(UIApplication *)application
{
{
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
Expand Down

0 comments on commit 016d7b4

Please sign in to comment.