title: Objective C - Strikethrough on Table Cell Label when complete
body: <p>Here is some working code that I have which adds a checkmark to a to-do item when it is complete:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *cellIdentifier = @"ListPrototypeCell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
      XYZToDoItem *toDoItem = [self.toDoItems objectAtIndex:indexPath.row];
      cell.textLabel.text = toDoItem.itemName;
      if (toDoItem.completed) {
          cell.accessoryType = UITableViewCellAccessoryCheckmark;
  
      } else {
           cell.accessoryType = UITableViewCellAccessoryNone;
      }    return cell;
  }
  </code></pre>
  
  <p>What I want to do is remove the checkmark code and some something like (basic logic of it):</p>
  
  <pre><code>    if (toDoItem.completed) {
          cellIdentifier.textLabel (NSAttributedString Strikethrough = YES)
  
      } else {
           cellIdentifier.textLabel (NSAttributedString Strikethrough = NO)
      }    return cell;
  </code></pre>
  
  <p>I've also tried to change <code>NSString</code> to <code>NSAttributedString</code> and <code>NSMutableAttributedString</code> based on some other questions and answers I've seen <a href="https://stackoverflow.com/questions/2489530/strike-through-font-in-objective-c/2489560#2489560">such as this one</a> like this:  </p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSDictionary* attributes = @{
                               NSStrikethroughStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
                               };
      static NSAttributedString* cellIdentifier = [[NSAttributedString alloc] initWithString:@"ListPrototypeCell" attributes:attributes];
      cell.textLabel.attributedText = cellIdentifier;
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
      XYZToDoItem *toDoItem = [self.toDoItems objectAtIndex:indexPath.row];
      cell.textLabel.text = toDoItem.itemName;
      if (toDoItem.completed) {
          cell.accessoryType = UITableViewCellAccessoryCheckmark;
  
  
      } else {
          cell.accessoryType = UITableViewCellAccessoryNone;
      }    return cell;
  }
  </code></pre>
  
  <p>But I'm not sure of the exact implementation, for example how to call this on the <code>if (toDoItem.completed)</code> method. This will only need to be supported by iOS7.</p>
  
  <p>How can I get the strikethrough effect on my Table Cell Label when the item is complete?</p>