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

iOS: Main-Thread: Proxies become nil if not created with pageContext

    Details

    • Type: Story
    • Status: Closed
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: Release 5.4.0
    • Component/s: iOS
    • Labels:

      Description

      This issue occurs in several cases when we want to use a proxy (like TiBlob and TiUILivePhoto) and running on main-thread. The usual warning is [WARN] Creating [object TiBlob] in a different context than the calling function.. Example:

      Ti.Media.openPhotoGallery({
          mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
          success: function(e) {
            Ti.API.warn(e.mediaType);
            Ti.API.warn(e.media);
          }
        });
       
      var win = Ti.UI.createWindow({backgroundColor: "#fff"});
      win.open();
      

      It is caused because we create a blob using TiBlob *media = [[[TiBlob alloc] initWithImage:resultImage]]; instead of using the page context:

      TiBlob *media = [[[TiBlob alloc\] _initWithPageContext:[self pageContext]] autorelease];
      [media setImage:resultImage];
      

      This issue effects TIMOB-19666 and possibly many other proxies that have not been tested, yet. We need to make sure that the proxies are created properly and write unit tests to ensure their integrity.

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              hknoechel Hans Knöchel
              Reviewer:
              Pedro Enrique (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code