I’m wondering if I could make a basic UITableView and statically set up everything using IB/Storyboarding in Xcode 4.2 but just one of the cells I want to display the current app version. (I’m making an about view) and I don’t want to hardcode the app version because I know I’ll forget to update it down the road. Is there any way to have that one cell get its data from the dataSource? I tried implementing
- (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];
}
// Configure the cell...
if (indexPath.section == 0 & indexPath.row == 0) {
cell.textLabel.text = [self appVersion];
}
return cell;
}
I’ve tried setting the cellIdentifier on all cells to @”Cell” as well as just setting it on the cell I care about modifying.
and only for that cell returning the app version but that wipes out the content of all the other cells.
Use different ID for the first row.