Hello.
I have two arrays, one for one section and one for another.
I just want to know how to get them into different sections.
Right now, with the code below, it just shows the same array for both sections.
I know I have to change the
to include both arrays, but when I use an array holding both arrays it crashes.
Any help?
I have two arrays, one for one section and one for another.
I just want to know how to get them into different sections.
Right now, with the code below, it just shows the same array for both sections.
Code:
- (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];
}
cell.textLabel.text = [array1 objectAtIndex:indexPath.row];
cell.backgroundColor = [UIColor colorWithWhite:100 alpha:.65f];
return cell;
}
}
I know I have to change the
Code:
cell.textLabel.text = [array1 objectAtIndex:indexPath.row];
Any help?