Titanium Community Questions & Answer Archive

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

Invalid Method

I am trying to learn and make a very simple test app.

I put this line

var data = [{title:"Row 1"},{title:"Row 2"}];
var table = Titanium.UI.createTableView({data:data});
win.add(table);

And I get a application error in the sim, (red screen_ saying invalid method, referring to the data attr.

Why would it do this?

— asked June 15th 2010 by M B
  • iphone
  • titanium mobile
0 Comments

1 Answer

  • Try this:

    var data = [];
    
    data[0] = Ti.UI.createTableViewRow({title:'Row 1'});
    data[1] = Ti.UI.createTableViewRow({title:'Row 2'});
    data[2] = Ti.UI.createTableViewRow({title:'Row 3'});
    data[3] = Ti.UI.createTableViewRow({title:'Row 4'});
    
    // create table view
    var tableview = Titanium.UI.createTableView({
        data:data
    });
    win.add(tableview);
    
    — answered June 16th 2010 by Ryan Gartin
    permalink
    1 Comment
    • IT was a bug in TI, that will get released in 1.4

      — commented June 16th 2010 by M B
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.