Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19922

iOS: Child WebView is not loaded when re-added back to the parent window

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Cannot Reproduce
    • Affects Version/s: Release 5.1.0, Release 5.0.2
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:

      Description

      Details: On iOS, the child WebView is not loaded when readded back to the parent window.

      Note: This is not a regression as this occurs with the current GA stack.

      Steps to reproduce:

      1. Create a Titanium classic project
      2. Replace app.js with the following code:

        var win = Ti.UI.createWindow({
        	backgroundColor : 'white'
        });
         
        var webview = Ti.UI.createWebView({
        	html : '<html><head></head><body><script>var now = Date.now(); document.body.innerHTML = now;</script></body></html>',
        	top : 0,
        	height : 200
        });
        webview.addEventListener('load', function() {
        	alert('The webview is loaded!');
        });
         
        var b = Ti.UI.createButton({
        	title : "remove and add webview",
        	top : 210
        });
        b.addEventListener("click", function() {
        	win.remove(webview);
        	win.add(webview);
        });
         
        var b2 = Ti.UI.createButton({
        	title : "remove and release and add webview",
        	top : 280
        });
        b2.addEventListener("click", function() {
        	win.remove(webview);
        	webview.reload();
        	win.add(webview);
        });
         
        win.add(webview);
        win.add(b);
        win.add(b2);
         
        win.open(); 
        

      3. Install app to device or simulator
      4. Once app is launched, dismiss the alert dialog
      5. Press remove and add webview or remove and release and add webview button

      Actual: The child WebView is never loaded (see no_load.png) and in the console, the following logs appear:

      [DEBUG] :  Loading: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/app.js, Resource: app_js
      [DEBUG] :  Loading: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/_app_props_.json, Resource: _app_props__json
      [DEBUG] :  Application booted in 135.113001 ms
      [DEBUG] :  New scheme: <NSMutableURLRequest: 0x146d81880> { URL: file:///var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/ }
      [DEBUG] :  CoreAnimation: failed to allocate IOSurface
      [TRACE] :  Uploaded tiapp metadata with Appcelerator Platform!
      [DEBUG] :  Cannot load file: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app. Error message was: Error Domain=NSCocoaErrorDomain Code=257 "The file ???monkey17027??? couldn???t be opened because you don???t have permission to view it." UserInfo={NSFilePath=/var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app, NSUnderlyingError=0x146dd90c0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
      [DEBUG] :  New scheme: <NSMutableURLRequest: 0x146da2e60> { URL: file:///var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/ }
      

      Expected: The child WebView should be loaded again.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cng Chee Kiat Ng (Inactive)
                Reporter:
                wluu Wilson Luu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20639
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration