[TIMOB-20396] iOS: Main-Thread: Cannot create proxies in callbacks
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-05T15:52:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.4.0 |
Components | iOS |
Labels | ios, mainthread, qe-5.4.0 |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2016-02-13T13:21:32.000+0000 |
Updated | 2016-07-29T21:39:24.000+0000 |
Description
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:
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();
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\]\];
.
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot 11.03.2016, 13.32.54.png | 2016-03-11T12:36:09.000+0000 | 79881 |
[~penrique] Added some more infos and screenshots.
PR: https://github.com/appcelerator/titanium_mobile/pull/7847
[~hansknoechel] [~wluu] and I have been unable to reproduce the issue above, do you have any more steps or ENV details that could help. Thanks
[~jlongton] Probably because it has been fixed / merged since a while. So if the above examples runs through, it's great and as supposed to be!
Verified as fixed. Tested on:
*Closing issue.*