Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy won't UITableViewCellAccessoryCheckMark Go Away?
    primarykey
    data
    text
    <p>Okay so I am slowly figuring this out. Just one more issue I am having. I am using a string and saying that if the string is equal to the cell text to put a checkmark on it when it loads the tableView. </p> <p>Here is my code for that:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if ([cell.textLabel.text isEqualToString:transferData]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; } </code></pre> <p>I am then telling it to remove that checkmark and add the checkmarks accordingly when being selected:</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { cell.accessoryType = UITableViewCellAccessoryNone; UITableViewCell *cellCheck = [tableView cellForRowAtIndexPath:indexPath]; cellCheck.accessoryType = UITableViewCellAccessoryCheckmark; transferData = cellCheck.textLabel.text; NSLog(@"%@", transferData); } - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* uncheckCell = [tableView cellForRowAtIndexPath:indexPath]; uncheckCell.accessoryType = UITableViewCellAccessoryNone; } </code></pre> <p>Everything works fine, except when it first loads. For some reason when I select on another cell, the checkmark that is originally loaded with the tableView won't go away. Why is this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload