You are doing it wrong - inside that function you have to create and return a cell.
Most common implementation is:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
return cell;
}
From what I see you want to return different cells for different rows - than you have to create if/else block inside that function that will dequeue proper cell type with unique identifier per type.
It will be good if you at least go through one of tutorials. here is the one which should help you: http://www.appcoda.com/customize-table-view-cells-for-uitableview/