Issue
If you have a Picker Column with a basic picker row added with just a title, and then have another row added with an object (label or Image) added to the row, the app will eventually crash after several picker row changes.
Code Sample
var win = Ti.UI.createWindow();
var picker = Ti.UI.createPicker({
top: 50,
left: 0,
right: 0,
selectionIndicator: true
});
win.add(picker);
var oCountryRows = [];
var colCountries = Ti.UI.createPickerColumn({
width: 100
});
//////WILL CRASH APP/////////////
var rowAny = Ti.UI.createPickerRow({
fontSize: 12,
font: {fontSize:12},
id: 0,
title: 'Any'
});
///////////////////////////////////
//////WORKS FINE///////////////////
// var rowAny = Ti.UI.createPickerRow();
// var coAnyLabel = Ti.UI.createLabel({
// text:'Any',
// color:'#000',
// textAlign:'center',
// font:{fontWeight:'bold', fontSize:12}
// });
// rowAny.add(coAnyLabel);
//////////////////////////////////////
colCountries.addRow(rowAny);
oDataCountry = [
{id:0,name:'England'},
{id:1,name:'France'},
{id:2,name:'Scotland'},
{id:3,name:'South-Africa'},
{id:4,name:'Turkey'},
{id:5,name:'Wales'}
];
for(var i=0;i<oDataCountry.length;i++) {
var row = Ti.UI.createPickerRow({
id:oDataCountry[i].id
});
var txt = Ti.UI.createLabel({height:30, width:80,text:oDataCountry[i].name, color:'#000'});
row.add(txt);
colCountries.addRow(row);
}
picker.add([colCountries]);
win.open();
Repro Steps
1.Drop code into app.js and run app
2.Scroll up and down through all the rows 2-3 times
3.App will freeze and crash
4.Comment out lines 18-23 and uncomment lines 27-34 and run app
5.Scroll up and down as much as you want, the app will not crash
Crash Log
See attached file for Crash Log
Tested on latest master with iPhone and iPad Sim (4.3, 5.0, 5.1) and iPhone 4(5.1.1). Could not reproduce. Probably fixed by the fix for TIMOB-6913
Cannot Reproduce. Verified On: Titanium Studio: 3.0.0.201210220122 Titanium SDK: 3.0.0.v20121019153308 iOS Simulator 4.3, 5.1