title: Property not found in cellForRowAtIndexPath: method
body: <p>I am getting an error which I don't understand because I have declared the property/ies. Have commented out the error in the AllListViewController.m file in the cellForRowAtIndexPath: method.</p>
  
  <p>Here are the files:</p>
  
  <p>Checklist.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Checklist : NSObject &lt;NSCoding&gt;
  
  @property (nonatomic, copy) NSString *name;
  @property (nonatomic, strong) NSMutableArray *items;
  @property (nonatomic, copy) NSString *iconName;
  
  -(int)countUncheckedItems;
  
  @end
  </code></pre>
  
  <p>Checklist.m</p>
  
  <pre><code>#import "Checklist.h"
  #import "ChecklistItem.h"
  
  @implementation Checklist
  
  
  -(id)initWithCoder:(NSCoder *)aDecoder
  {
      if ((self = [super init])) {
          self.name = [aDecoder decodeObjectForKey:@"Name"];
          self.items = [aDecoder decodeObjectForKey:@"Items"];
          self.iconName = [aDecoder decodeObjectForKey:@"IconName"];
      }
      return self;
  }
  
  -(void)encodeWithCoder:(NSCoder *)aCoder
  {
      [aCoder encodeObject:self.name forKey:@"Name"];
      [aCoder encodeObject:self.items forKey:@"Items"];
      [aCoder encodeObject:self.iconName forKey:@"IconName"];
  }
  
  -(id)init
  {
      if ((self = [super init])) {
          self.items = [[NSMutableArray alloc] initWithCapacity:20];
          self.iconName = @"Appointments";
      }
      return self;
  }
  
  -(int)countUncheckedItems
  {
      int count = 0;
      for (ChecklistItem *item in self.items) {
          if (!item.checked) {
              count += 1;
          }
      }
      return count;
  }
  
  -(NSComparisonResult)compare:(Checklist *)otherChecklist
  {
      return [self.name localizedStandardCompare:otherChecklist.name];
  }
  @end
  </code></pre>
  
  <p>AllListsViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "ListDetailViewController.h"
  
  @class DataModel;
  
  @interface AllListsViewController : UITableViewController &lt;ListDetailViewControllerDelegate, UINavigationControllerDelegate&gt;
  
  @property (nonatomic, strong) DataModel *dataModel;
  
  @end
  </code></pre>
  
  <p>AllListsViewController.m</p>
  
  <pre><code>#import "AllListsViewController.h"
  #import "Checklist.h"
  #import "ChecklistViewController.h"
  #import "ChecklistItem.h"
  #import "DataModel.h"
  
  @interface AllListsViewController ()
  
  @end
  
  @implementation AllListsViewController
  
  - (id)initWithStyle:(UITableViewStyle)style
  {
      self = [super initWithStyle:style];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      // Uncomment the following line to preserve selection between presentations.
      // self.clearsSelectionOnViewWillAppear = NO;
  
      // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
      // self.navigationItem.rightBarButtonItem = self.editButtonItem;
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      [self.dataModel setIndexOfSelectedChecklist:indexPath.row];
  
      Checklist *checklist =  self.dataModel.lists[indexPath.row];
      [self performSegueWithIdentifier:@"ShowChecklist" sender:checklist];
  }
  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if ([segue.identifier isEqualToString:@"ShowChecklist"]) {
          ChecklistViewController *controller = segue.destinationViewController;
          controller.checklist = sender;
      }
      else if ([segue.identifier isEqualToString:@"AddChecklist"]) {
          UINavigationController *navigationController = segue.destinationViewController;
          ListDetailViewController *controller = (ListDetailViewController *)navigationController.topViewController;
  
          controller.delegate = self;
          controller.checklistToEdit = nil;
      }
  }
  
  -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
  {
      UINavigationController *navigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"ListNavigationController"];
  
      ListDetailViewController *controller = (ListDetailViewController *)navigationController.topViewController;
  
      controller.delegate = self;
  
      Checklist *checklist = self.dataModel.lists[indexPath.row];
      controller.checklistToEdit = checklist;
  
      [self presentViewController:navigationController animated:YES completion:nil];
  }
  
  #pragma mark - Table view data source
  
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  
      // Return the number of rows in the section.
      return [self.dataModel.lists count];
  }
  
  -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      [self.dataModel.lists removeObjectAtIndex:indexPath.row];
  
      NSArray *indexPaths = @[indexPath];
      [tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc]
                  initWithStyle:UITableViewCellStyleSubtitle
                  reuseIdentifier:CellIdentifier];
         cell.imageView.image = [UIImage imageNamed:Checklist.iconName]; /* Use of undeclared identifier; did you mean 'Checklist'? or Property 'iconName' not found on object of type 'Checklist'*/
          return cell;
      }
  
      Checklist *checklist = self.dataModel.lists[indexPath.row];
      cell.textLabel.text = checklist.name;
      cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
  
      cell.detailTextLabel.text = [NSString stringWithFormat:@"%d Remaining", [checklist countUncheckedItems]];
  
      int count = [checklist countUncheckedItems];
      if ([checklist.items count] == 0) {
          cell.detailTextLabel.text = @"(No Items)";
      } else if (count == 0) {
          cell.detailTextLabel.text = @"All Done";
      } else {
          cell.detailTextLabel.text = [NSString stringWithFormat:@"%d Remaining", count];
      }
  
      return cell;
  }
  
  /*
  // Override to support conditional editing of the table view.
  - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the specified item to be editable.
      return YES;
  }
  */
  
  /*
  // Override to support editing the table view.
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if (editingStyle == UITableViewCellEditingStyleDelete) {
          // Delete the row from the data source
          [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
      }   
      else if (editingStyle == UITableViewCellEditingStyleInsert) {
          // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
      }   
  }
  */
  
  /*
  // Override to support rearranging the table view.
  - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
  {
  }
  */
  
  /*
  // Override to support conditional rearranging of the table view.
  - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the item to be re-orderable.
      return YES;
  }
  */
  
  /*
  #pragma mark - Navigation
  
  // In a story board-based application, you will often want to do a little preparation before navigation
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      // Get the new view controller using [segue destinationViewController].
      // Pass the selected object to the new view controller.
  }
  
   */
  
  -(void)listDetailViewControllerDidCancel:(ListDetailViewController *)controller
  {
      [self dismissViewControllerAnimated:YES completion:nil];
  }
  
  -(void)listDetailViewController:(ListDetailViewController *)controller didFinishAddingChecklist:(Checklist *)checklist
  {
      [self.dataModel.lists addObject:checklist];
  
      [self.dataModel sortChecklists];
      [self.tableView reloadData];
  
      [self dismissViewControllerAnimated:YES completion:nil];
  
  }
  
  -(void)listDetailViewController:(ListDetailViewController *)controller didFinishEditingChecklist:(Checklist *)checklist
  {
      [self.dataModel sortChecklists];
      [self.tableView reloadData];
  
      [self dismissViewControllerAnimated:YES completion:nil];
  }
  
  -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
  {
      if(viewController == self) {
          [self.dataModel setIndexOfSelectedChecklist:-1];
      }
  }
  
  -(void)viewWillAppear:(BOOL)animated
  {
      [super viewWillAppear:animated];
      [self.tableView reloadData];
  }
  
  
  
  -(void)viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:animated];
  
      self.navigationController.delegate = self;
  
      NSInteger index = [self.dataModel indexOfSelectedChecklist];
  
      if(index &gt;= 0 &amp;&amp; index &lt; [self.dataModel.lists count]) {
          Checklist *checklist = self.dataModel.lists[index];
          [self performSegueWithIdentifier:@"ShowChecklist" sender:checklist];
      }
  }
  
  @end
  </code></pre>