Permalink
Browse files

Update ExampleAppDelegate for new jsBridge interface.

  • Loading branch information...
1 parent eddeba4 commit 016d7b4926bd49329bd51479c070adc725c317d3 @psineur psineur committed Oct 27, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 WebViewJavascriptBridge/ExampleAppDelegate.m
@@ -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);
}
@@ -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.

0 comments on commit 016d7b4

Please sign in to comment.