Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked June 2nd 2010 by Michael Gajda
  • array
  • chrash
  • error
  • iphone
  • mobile
  • picker
  • pickerrow
  • row
0 Comments

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.

    — answered June 2nd 2010 by Dan Tamas
    permalink
    0 Comments
  • 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);
         }
    };
    
    — answered June 2nd 2010 by Michael Gajda
    permalink
    0 Comments
  • 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);
         }
    };
    
    — answered June 2nd 2010 by Michael Gajda
    permalink
    0 Comments
  • 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);
         }
    };
    
    — answered June 2nd 2010 by Michael Gajda
    permalink
    0 Comments
  • 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);
         }
    };
    
    — answered June 2nd 2010 by Michael Gajda
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.