This is not a regression since same scenario occurs in 3.4.1 GA
Titanium app is crashing when we add same tab more than once in a TabGroup.
Console logs and Crash logs are attached here.
Steps To Reproduce
1. Create a classic app using following code
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title : 'Tab',
backgroundColor : '#fff'
});
var tab = Titanium.UI.createTab({
icon : 'KS_nav_ui.png',
title : 'Tab',
window : win
});
var button = Titanium.UI.createButton({
top : 10,
title : 'Add tab1'
});
button.addEventListener('click', function(e) {
tabGroup.addTab(tab1);
});
win.add(button);
// create tab1 and win1
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
var tab1 = Titanium.UI.createTab({
icon : 'KS_nav_ui.png',
title : 'Tab 1',
window : win1
});
tabGroup.addTab(tab);
tabGroup.open();
2. Run on iOS device
3. Click the *Add tab1* button ( It will add a new tab with name *Tab 1* )
4. Click the button many times until you get *More...* tab
5. Click on the *More...* tab
Actual Result
App is crashing when *More* tab is clicked.
Expected Result
App should not crash. We should handle this gracefully.
Note: It can either prevent adding same tab again or allowing them with renaming the properties.
My preference is that the application spit out an error and only add the tab once.
This issue is invalid. The demo-code used a circular memory reference that caused the tabs to be referenced outside a scope. The correct use-case would generate and add the tabs as soon the the button is clicked. I made an iterative example that uses a counter to create n tabs. The "More" tab can be clicked without crashes and everything works as expected:
Closing ticket as invalid with reference to the above comments.