Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2762] iPad crash in modal window with option dialog

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2011-12-29T06:34:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterDanny Pham
AssigneeMauro Parra-Miranda
Created2011-10-28T04:31:28.000+0000
Updated2016-03-08T07:47:40.000+0000

Description

Problem

iPad always crashes when I try to open an option dialog in a modal window. iPhone not affected.

Test case

var winTest = Ti.UI.createWindow({
    url:'test.js'
});
 
winTest.open({modal:true});
var win = Ti.UI.currentWindow;
 
var actionButton = Ti.UI.createButton({
    systemButton:Ti.UI.iPhone.SystemButton.ACTION
});
 
win.setRightNavButton(actionButton);
 
actionButton.addEventListener('click',function(e) {
    var dialog = Ti.UI.createOptionDialog({
        title: 'Hello',
        options: ['Option 1','Option 2'],
        cancel:1
    });
 
    dialog.show();  
});

Logs

2011-10-27 17:24:06.278 myApp[28876:207] *** Assertion failure in -[UIActionSheet showInView:], /SourceCache/UIKit_Sim/UIKit-1448.89/UIActionSheet.m:4402
 
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x03dfe5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x03c2d313 objc_exception_throw + 44
    2   CoreFoundation                      0x03db6ef8 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x007f03bb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   UIKit                               0x00d8b3c2 -[UIActionSheet showInView:] + 162
    5   UIKit                               0x00d8f8ab -[UIActionSheet _presentPopoverInCenterOfWindowForView:] + 281
    6   myApp                               0x000aa933 -[TiUIOptionDialogProxy updateOptionDialogNow] + 1059
    7   myApp                               0x000aa127 -[TiUIOptionDialogProxy show:] + 3143
    8   Foundation                          0x0077494e __NSThreadPerformPerform + 251
    9   CoreFoundation                      0x03ddf8ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    10  CoreFoundation                      0x03d3d88b __CFRunLoopDoSources0 + 571
    11  CoreFoundation                      0x03d3cd86 __CFRunLoopRun + 470
    12  CoreFoundation                      0x03d3c840 CFRunLoopRunSpecific + 208
    13  CoreFoundation                      0x03d3c761 CFRunLoopRunInMode + 97
    14  GraphicsServices                    0x042761c4 GSEventRunModal + 217
    15  GraphicsServices                    0x04276289 GSEventRun + 115
    16  UIKit                               0x00a03c93 UIApplicationMain + 1160
    17  myApp                               0x00003dba main + 442
    18  myApp                               0x00002705 start + 53
    19  ???                                 0x00000001 0x0 + 1
)
 
abort() called

Discussions

Q&A: [ipad crash in modal window with option dialog](http://developer.appcelerator.com/question/127452/ipad-crash-in-modal-window-with-option-dialog)

Comments

  1. Paul Dowsett 2011-12-29

    Hi Danny For your future tickets, please note the changes I have made. An option dialog is a [modal window](http://en.wikipedia.org/wiki/Modal_window) itself, so it seems counter-intuitive to open one in a modal window. The fact that this does not crash on iphone may be just luck. I will find out more about this before I move it across. Putting it on hold for now. Thanks for your patience
  2. Danny Pham 2011-12-29

  3. Paul Dowsett 2011-12-29

    Thanks for the update, Danny
  4. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source