The code which are written is enough for your situation. Just remove this line if (indexPath.section==0){
in cellForRowAtIndexPath
.
Update: According to your point , following code is enough. If you correctly stored into posts
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier1 = @"Cell";
UITableViewCell *cell = nil;
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1];
}
if (indexPath.row==0)
{
cell.textLabel.text = [[self.posts objectAtIndex:indexPath.section] objectForKey:@"name"];//Here modified `section` instead of `row`
}
else if (indexPath.row==1)
{
cell.textLabel.text = [[self.posts objectAtIndex:indexPath.section] objectForKey:@"message"];
}
return cell;
}