First, note that cellForRowAtIndexPath is called several times - once for each cell. I think your best option is to declare an array and populate it with the objects you want to display as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *days[] = {@"Mon", @"Tues", @"Wed", @"Thurs", @"Fri", @"Sat", @"Sun"};
static NSString *CellIdentifier = @"Cell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
[[cell textLabel] setText:days[indexPath.row]];
return cell;
}
- , . ( ), setText :
[[cell textLabel] setText:[yourArray objectAtIndex:indexPath.row]];
, . :
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
return yourImageView;
}