Project: titanium
Issue TIMOB-20396: iOS: Main-Thread: Cannot create proxies in callbacks
Not sure how to proper name this ticket, but it's something with the going wrong. So whenever we want to create a {{Ti.UI.iOS.*}} proxy e.g. {{Ti.UI.iOS.Toolbar}} or {{Ti.UI.iOS.LivePhotoView}} inside a callback of a {{Ti.Media.openPhotoGallery}} (and probably other async callbacks), the proxy cannot be found and it throws the attached error. Example: {code:javascript} Ti.Media.openPhotoGallery({ mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO], success: function(e) { var toolbar = Ti.UI.iOS.createToolbar({ width: 300, height: 30, backgroundColor: "#f00" }); win.add(toolbar); } }); var win = Ti.UI.createWindow({backgroundColor: "#fff"}); win.open(); {code} The example will crash as soon as the callback is invoked. If we call it directly, the app wont crash. Note: The warning {{\[WARN\] Creating \[object TiUIiOS\] in a different context than the calling function.}} is logged before the crash. So it might be related to TIMOB-20397, although the {{TiUIiOSProxy}} gets initialized correctly with {{\[\[TiUIiOSProxy alloc\] _initWithPageContext:\[self executionContext\]\];}}.
Story points: 3