Javascript interface with iPhone webview

I am converting coding from Android to iPhone, below is the code listen to "jb" from javascript in Android webview. How can I implement the code in iPhone?

  webView.loadUrl(url); 
    webView.setWebViewClient(new AppWebViewClient ());
    webView.addJavascriptInterface(new JavascriptBridge(), "jb");


final class JavascriptBridge
    {
        public void callback(String param){

            //Generate the returnValue from the bridge
            /*
            String toastValue = param
            Toast toast = Toast.makeText(AppHelp.this, toastValue, Toast.LENGTH_LONG);
            toast.show();
            */
            Log.i(TAG, param);
            if (param.equals("close")) {
                AppHelp.this.finish();
            }

        }
    }
6
задан Ibu 28 May 2011 в 08:57
поделиться