Fill picker - after adding the array my application chrashs
Hi,
i got an issue with my picker.
I fill my dataArray in a loop. Then i check if the Array length is 253 with
if (dataArray.length == 253){ picker.add(dataArray)}
Now im starting the app and after executing the if (data… the app chrashes.
Any ideas or suggestions?
5 Answers
-
dataArray.length == 253 ??
Isn't this a little too long for a picker view?
With a shorter array ( 10 entries ) it works? maybe the problem is how you declare the pickerrows in array.
-
Thank you for the fast response!
I know this is a lot of data…
But even with only 10 entries it crashes.
Here my complete code: (this function gets it content from another function)
var z=0; function extractCityName(){ var dataKey = 'json-city'; var cityName = usersession.data[dataKey].city.name; cityData[z] = Ti.UI.createPickerRow({title: cityName}); apiInfo('search.js - data.legth: ' + cityData.length) z++; if (cityData.length == 10) { // i changed it to 10 cityPicker.add(cityData); } };
-
Thank you for the fast response!
I know this is a lot of data…
But even with only 10 entries it crashes.
Here my complete code: (this function gets it content from another function)
var z=0; function extractCityName(){ var dataKey = 'json-city'; var cityName = usersession.data[dataKey].city.name; cityData[z] = Ti.UI.createPickerRow({title: cityName}); apiInfo('search.js - data.legth: ' + cityData.length) z++; if (cityData.length == 10) { // i changed it to 10 cityPicker.add(cityData); } };
-
Thank you for the fast response!
I know this is a lot of data…
But even with only 10 entries it crashes.
Here my complete code: (this function gets it content from another function)
var z=0; function extractCityName(){ var dataKey = 'json-city'; var cityName = usersession.data[dataKey].city.name; cityData[z] = Ti.UI.createPickerRow({title: cityName}); apiInfo('search.js - data.legth: ' + cityData.length) z++; if (cityData.length == 10) { // i changed it to 10 cityPicker.add(cityData); } };
-
Thank you for the fast response!
I know this is a lot of data…
But even with only 10 entries it crashes.
Here my complete code: (this function gets it content from another function)
var z=0; function extractCityName(){ var dataKey = 'json-city'; var cityName = usersession.data[dataKey].city.name; cityData[z] = Ti.UI.createPickerRow({title: cityName}); apiInfo('search.js - data.legth: ' + cityData.length) z++; if (cityData.length == 10) { // i changed it to 10 cityPicker.add(cityData); } };