完全な説明でもう一度質問して申し訳ありません。サーバーから取得したタイトルの説明などを持つresultsArrayがありますが、問題はこのデータをセクションに表示したいということです。
したがって、配列から来る 3 つのセクションがある場合、単一の resultArray を使用して各セクションにデータを入力する方法を考えてみましょう。
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [categoryArray objectAtIndex:section];
}
resutArray にはすべてのセクションのすべてのデータがあるため、セクションに従って表示する方法
配列の構造は
ObjectData *theObject =[[ObjectData alloc] init];
[theObject setCategory:[dict objectForKey:@"category"]];
[theObject setSub_Category:[dict objectForKey:@"sub_Category"]];
[theObject setContent_Type:[dict objectForKey:@"content_Type"]];
[theObject setContent_Title:[dict objectForKey:@"content_Title"]];
[theObject setPublisher:[dict objectForKey:@"publisher"]];
[theObject setContent_Description:[dict objectForKey:@"content_Description"]];
[theObject setContent_ID:[dict objectForKey:@"content_ID"]];
[theObject setContent_Source:[dict objectForKey:@"content_Source"]];
[resultArray addObject:theObject];