我正在开发一个在 iPhone 中显示联系人的 Titanium 应用程序。当用户选择用户的电子邮件属性时,我将显示电子邮件编辑器窗口。
但是我的应用程序崩溃并且控制台显示:
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from <ABPeoplePickerNavigationController: 0xb1b7940> to <MFMailComposeViewController: 0x1508c880> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed'
*** First throw call stack:
(0x33fb012 0x2e4de7e 0x33fae78 0x923f35 0xf55d05 0xd544f3 0x33ef1bd 0x33ef0d6 0xd481c5 0xd53342 0x1fb1402 0x1fb1dbd 0x1fb1c30 0x11af4e9 0x370b53f 0x371d014 0x370d7d5 0x33a1af5 0x33a0f44 0x33a0e1b 0x31137e3 0x3113668 0xc6a65c 0x33c8 0x27d5)
我正在使用以下代码:
var values = {cancel:function(){}};
values.fields = ['firstName','email'];
function showContacts()
{
Titanium.Contacts.showContacts(values);
};
values.selectedProperty = function(e) {
if(e.property == 'email')
{
var emailDialog = Titanium.UI.createEmailDialog();
emailDialog.subject = "Hello from Titanium";
emailDialog.toRecipients = [e.value];
emailDialog.messageBody = 'Appcelerator Titanium Rocks!';
if(emailDialog.isSupported())
{
emailDialog.open();
}
}
}
我知道这个错误是因为我试图在联系人窗口被关闭时显示电子邮件编辑器。
关闭联系人窗口后如何显示电子邮件编辑器?
请帮我。提前致谢。