0

I have an array which looks as follows.

Records -> list of records -> each record has 9 different records below is the output from console.

this is what happens when i print the array to console

2011-03-23 17:21:25.003 twosmsapp[5189:207] (
    447879652048,
    SUCCESS,
    "2011-03-23T15:56:54.222Z",
    "2011-03-23T15:56:54.223",
    "",
    "2011-03-23T15:56:55.977",
    "2011-03-23T15:57:04.177",
    Lalalalala,
    "2011-03-23 15:56:54.450ZVCLMKDRWBETW84AL"
)
2011-03-23 17:21:25.004 twosmsapp[5189:207] (
    447790686158,
    SUCCESS,
    "2011-03-23T12:24:12.844Z",
    "2011-03-23T12:24:12.843",
    "",
    "2011-03-23T12:24:13.540",
    "2011-03-23T12:24:23.453",
    "Another test",
    "2011-03-23 12:24:12.937CFOCJHXSZIETW85TS"
)
2011-03-23 17:21:25.004 twosmsapp[5189:207] (
    447790686158,
    SUCCESS,
    "2011-03-23T09:22:36.339Z",
    "2011-03-23T09:22:36.340",
    "",
    "2011-03-23T09:22:37.257",
    "2011-03-23T09:22:48.290",
    Hellloooo,
    "2011-03-23 09:22:36.660BJJJFMCSZIETW85OO"
)

I'm wanting to display this data in my tableView. Any ideas?

2
  • Shouldn't the Hellloooo and Lalalalala be quoted strings? Commented Mar 23, 2011 at 18:09
  • please see this question stackoverflow.com/questions/5406424/… Commented Mar 23, 2011 at 19:05

1 Answer 1

1

As posted in your other question, here is how you were making your array:

[records addObject:[NSArray arrayWithObjects:
                                  [TBXML textForElement:destination],
                                  [TBXML textForElement:status],
                                  [TBXML textForElement:guid],
                                  [TBXML textForElement:dateSub],
                                  [TBXML textForElement:dateToSend],
                                  [TBXML textForElement:dateSent],
                                  [TBXML textForElement:dateReceived],
                                  [TBXML textForElement:message],
                                  [TBXML textForElement:id],nil]]; 

So, here is how you would display the destination, status, dateSent, and message all on one line on your cell: (might have to shrink your text size a bit)

cell.textLabel.text = [NSString stringWithFormat:@"%@, %@, %@, %@",
                          [[records objectAtIndex:indexPath.row] objectAtIndex:0],
                          [[records objectAtIndex:indexPath.row] objectAtIndex:1],
                          [[records objectAtIndex:indexPath.row] objectAtIndex:5],
                          [[records objectAtIndex:indexPath.row] objectAtIndex:7]];
Sign up to request clarification or add additional context in comments.

1 Comment

@MrPink: No problem! Hope everything works well for you. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.