gpt4 book ai didi

iphone - 在tableView中显示数组中的数据

转载 作者:行者123 更新时间:2023-11-29 05:05:33 25 4
gpt4 key购买 nike

我有一个如下所示的数组。

记录 -> 记录列表 -> 每条记录有 9 个不同的记录,下面是控制台的输出。

这就是我将数组打印到控制台时发生的情况

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"
)

我想在我的 tableView 中显示这些数据。有什么想法吗?

最佳答案

正如您在其他问题中所发布的,以下是您制作数组的方式:

[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]];

因此,以下是您如何在单元格的一行上显示目的地、状态、发送日期和消息:(可能需要稍微缩小文本大小)

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]];

关于iphone - 在tableView中显示数组中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5409177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com