Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12451

webViewDidFinishLoad delegate no longer available in CDVViewController

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • cordova-ios@4.3.1
    • cordova-ios@4.3.1
    • cordova-ios, cordova-lib
    • None
    • phonegap cli version 6.4.3, cordova cli 6.5.0, cordova platform version iOS 4.3.1. Project uses default UIWebView. Problem is experienced on iOS 9.3.5 through 10.2 on iPhone 4, iPhone 4S and iPhone 5 (these were only the ones tested)

    Description

      This is a phone gap project and all object types are exactly as created when the cordova platform add iOS CLI command is executed. When using UIWebView, I manually change the interface (.h) for MainViewController.h which is a CDVViewController type to call the delegates (by adding <UIWebViewDelegate> to the interface, which means the webViewDidFinishLoad gets called, but compile fails on the [super webViewDidFinishLoad:theWebView] call with the message that there is no interface in CDVViewController for webViewDidFinishLoad. When I check the CDVViewController.m and .h files, I see the selectors / methods are no longer present when comparing to pre-4.0 cordova versions. If I then remove the [super ...] call to get it to compile then the deviceready is never called and i have to make my app lose focus before it will load.Ive added in the required <meta> tag to index.html which has no effect. I am aware the delegate is present in other files such as the navigator and CDVUIWebViewDelegate.h but these are not called or available from CDVViewController.

      I have a few apps that rely on this once standard delegate callback. I need it to be called because it is the only way i can think of to get a reference to the UIWebView that cordova uses as default. Sure, I can access self.webView or even reference the viewController webview property in other places but NONE of these are UIWebView... they are all UIView and do not allow me to call the stringByEvaluatingJavaScriptByString selector in order to execute JavaScript in the same "virtual machine" as my app runs and therefore have access to the methods in there.

      Attachments

        Activity

          People

            jcesarmobile jcesarmobile
            willmam Mark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: