Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7952719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:56:37+00:00 2026-06-04T02:56:37+00:00

I have trouble to parse and show events from Bands in Town´s API in

  • 0

I have trouble to parse and show events from Bands in Town´s API in my appcelerator mobile app. (iOS)
This is my bands event that i want to show in a table.
http://api.bandsintown.com/artists/Lucy%20Seven/events.json?api_version=2.0&app_id=LucySeven
And this is the code that i have for showing it

var win = Ti.UI.currentWindow;

win.hideNavBar();

Ti.UI.backgroundColor = '#050505';

var url = "http://api.bandsintown.com/artists/Lucy%20Seven/events.json?      api_version=2.0&app_id=LucySeven"

var table = Ti.UI.createTableView({

        backgroundColor: '#050505',
        separatorColor:'#110000',
    });
var tableData = [];
var json, artists, name, picture, title, description;

var xhr = Ti.Network.createHTTPClient({
onload: function() {
// Ti.API.debug(this.responseText);

json = JSON.parse(this.responseText);
for (i = 0; i < json.data.length; i++) {
    data = json.data[i];
    row = Ti.UI.createTableViewRow({
        height:'100dp',
        backgroundColor: '#050505',
        separatorColor:'#110000',
    });
  var  name = Ti.UI.createLabel({
        text: title,
        font:{
            fontSize:'17dp',
        fontWeight:'bold'
    },
    height:'auto',
    left:'90dp',
    top:'20dp',
    color:'#eee',
    touchEnabled:true
    });
    row.add(name);


        var  start = Ti.UI.createLabel({
        text:   description,
        font:{
            fontSize:'12dp'
        },
    height:'auto',
    left:'90dp',
    bottom:'20dp',
    color:'#eee',
    touchEnabled:true
    });
    row.add(start);


  // Avatar
            var img = Ti.UI.createImageView({
                image   : thumb_url ,
                width   : 70,
                height  : 70,
                top     : 5,
                bottom  : 5,
                borderRadius: 5,
                borderColor: '#eee',
                left    : 5
            });
            row.add(img);


    tableData.push(row);
    }

table.setData(tableData);
},
onerror: function(e) {
Ti.API.debug("STATUS: " + this.status);
Ti.API.debug("TEXT:   " + this.responseText);
Ti.API.debug("ERROR:  " + e.error);
alert('There was an error retrieving the remote data. Try again.');
},
timeout:5000
});

xhr.open("GET", url);
xhr.send();

There is a API responses for json here:
http://www.bandsintown.com/api/responses#events-json
I really cant see what is wrong… Maybe im to blind to see what i have missed?
I would appreciate if someone could point me in the right direction on this.
i have tried with: data.title data.artists.title title artists.titel and so on but nothing have shown up in my tableview…..
Thanx
//R

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:56:38+00:00Added an answer on June 4, 2026 at 2:56 am

    What’s the value of this.responseText and what’s the value of json after JSON.parse? In the JSON response I don’t see a data property so I’m not sure what json.data is supposed to be. Also in Ti.UI.createLabel you give test: title but title is never given a value.

    I suspect what you really want in your for loop is this:

    json = JSON.parse( this.responseText ); // `json` will be an array of objects
    
    for (i = 0; i < json.length; i++) {
      data = json[ i ];
      // ...
    
      var name = Ti.UI.createLabel( {
        text: data.title,
        // ...
      } );
    }
    

    The key to debugging this is the same as debugging many things—find out what data you have at each step (I’ve never used Titanium but it must have something like console.log at the very least) and figure out how it differs from what you expect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble reading from an Excel spreadsheet in C#. I have this
I have trouble figuring out why a simple division like this one always returns
I have trouble doing this... You may want to get the same result as
I have trouble finding way to correctly refactor this code so that there would
I have some trouble with python. I am trying to get output from a
I have some trouble reading from an ini file using boost program options. The
I have a next trouble. In database date storred as md5 from date. When
I'm having trouble with my app trying to parse a date with the America/Chicago
i have a json file with unicode characters, and i'm having trouble to parse
I have some trouble during post my data, show 500 internal server error. So,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.