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 7172239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:34:33+00:00 2026-05-28T15:34:33+00:00

I’ve been messing around with this for a while now, but I can’t seem

  • 0

I’ve been messing around with this for a while now, but I can’t seem to get it done.

I get tasks as JSON-data back from my API. The data looks like this, printed with Ti.API.info(this.responseText):

[INFO] [{"created_at":"2012-01-09T15:05:25Z","description":"Smullen van onze pizza","id":1,"title":"Pizza Eten","updated_at":"2012-01-09T15:05:25Z","user_id":11},{"created_at":"2012-01-09T15:05:25Z","description":"Lekker Lekker!","id":21,"title":"Ice-Tea Drinken","updated_at":"2012-01-09T15:05:25Z","user_id":11}]

I’m not quite sure how to process this data. I tried a couple of things:

getData.onload = function(){
    var tasks = this.responseText;
    for(t in tasks) {
        Ti.API.info(t);
    }
        }

This printed:

[INFO] 0
[INFO] 1
[INFO] 2
[INFO] 3
[INFO] 4
[INFO] 5
[INFO] 6

till 306.

Another thing I tried was:

var tasks = this.responseText;
for(t in tasks)
{
    if(tasks.hasOwnProperty(t))
    {
        Ti.API.info(t + " -> " + tasks[t]);
    }
}

This gave me:

[INFO] 0 -> [
[INFO] 1 -> {
[INFO] 2 -> "
[INFO] 3 -> c
[INFO] 4 -> r
[INFO] 5 -> e
[INFO] 6 -> a
[INFO] 7 -> t
[INFO] 8 -> e
[INFO] 9 -> d

Another try:

var tasks = this.responseText;
for(t in tasks)
{
    Ti.API.info(t.title);
}

Gave:

[INFO] <null>
[INFO] <null>
[INFO] <null>

I’m really confused how to process this JSON and how to ‘prepare’ it so i can use it in a tableview. Anyone can help me out here? Thanks.

  • 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-05-28T15:34:34+00:00Added an answer on May 28, 2026 at 3:34 pm

    as skypanther already pointed out. you need to parse your json string to an object. it’s well explained at json.org. after you parsed your string into an object it is easy to access its members and create your tableview row.

    /* create the tableview row */
    makeTableViewRow = function(_object){
    
      var row = Ti.UI.createTableViewRow({
         ...
      }]
    
      var title = Ti.UI.createLabel({
         ...
         text: _object.title,
         ...
      });
      row.add(title);
    
      return row;
    };
    
    
    getData.onload = function(){
      var tasks = json.parse(this.responseText), /* parse the json string */
          _rowsForTableView = []; /* put the rows in here */
    
      /* create the rows */
      for (i in tasks){
         var _row = makeTableView(tasks[i]);
         _rowsForTableView.push(_row);
      };
    
      myTableView.setData(_rowsForTableView);
    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I want to construct a data frame in an Rcpp function, but when I
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.