Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在聊天对话框窗口等表格视图中显示左右两个数组值_Ios_Objective C - Fatal编程技术网

Ios 如何在聊天对话框窗口等表格视图中显示左右两个数组值

Ios 如何在聊天对话框窗口等表格视图中显示左右两个数组值,ios,objective-c,Ios,Objective C,我有两个数组,一个是senderArray,另一个是ReceiveArray。在这两个数组中,我都有JSON格式的消息数据 现在我想显示表视图的LeftReceiveArray和rightsenderArray中的所有数据 像这样的- 请告诉我怎么做 使用tableView的委托方法 (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 在单元格

我有两个数组,一个是senderArray,另一个是ReceiveArray。在这两个数组中,我都有JSON格式的消息数据

现在我想显示表视图的LeftReceiveArray和rightsenderArray中的所有数据

像这样的-


请告诉我怎么做

使用tableView的委托方法

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

在单元格中设置相应的数组数据。

NSARRAY,可以通过TableView CustomCell进行设置。在UITableView CustomCell中,使用两个标签,将第一个标签设置为右侧,另一个标签设置为左侧。将JSON解析数据数组显示在此标签中。

我知道,但数据将如何设置为左侧和右侧,如聊天窗口我在两个数组中都有100条消息,我必须在左侧和右侧显示所有消息right@NSArray可能不在UITableViewCell*tableView:UITableView*tableView cellForRowAtIndexPath:NSIndexPath*indexPath和Set中UITableView中的行数是您的数组计数,设置部分等于1。@NSArray然后使用Custum Libraray[link]希望对您有所帮助。接受否决票。请理解,我想在自定义窗口中显示聊天对话框检查此项