Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *CellIdentifier = @"Cell";
- CustomCell *tableCell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (tableCell == nil)
- {
- NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
- tableCell = [nib objectAtIndex:0];
- }
- // Configure the cell...
- [tableCell.backgroundImage setBackgroundImage:.....]
- return tableCell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSLog(@"%@",m_indexPath);
- CustomCell *previouslySelectedCell = (CustomCell*)[tableView cellForRowAtIndexPath:m_indexPath];
- [previouslySelectedCell.backgroundImage setImage:nil];
- [tableView deselectRowAtIndexPath:m_indexPath animated:YES];
- CustomCell * cell = (CustomCell* )[tableView cellForRowAtIndexPath:indexPath];
- NSLog(cell.selectionStatus ? @"Yes" : @"No");
- [cell.backgroundImage setImage:.......];
- m_indexPath = indexPath;
- }
- - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- CustomCell * cell = (CustomCell* )[tableView cellForRowAtIndexPath:indexPath];
- [cell.backgroundImage setImage:nil];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement