Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
[[cell imageView] setImage:[UIImage imageNamed:@"Tick.png"]];
}
[[cell imageView] setHidden:YES];
if (indexPath.row == selectedRow)
{
[[cell imageView] setHidden:NO];
}
NSString *cellValue =[listOfItems objectAtIndex:indexPath.row];
cell.text = cellValue;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Set up the cell...
selectedRow = indexPath.row;
[self.tableView reloadData];
}
viewDidLoad
selectedRow =-1
My question about UITableView cell selection for navigation base application . After selecting my cell i am indicating in check mark for cell left side is selected. When its return to FirstviewController and back to UITableView if i check row there is no selection cell check mark. what happening now . Because i am already selected my cell. how to make selected cell is selected in appdelegate