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)
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
Thanks for the update, Danny
DUP issue.