title: Use of undeclared identifier 'location'
body: <p>Am getting this error on several lines which I have commented out, and wonder why I am getting this problem? What is the best way to fix this?</p>
  
  <p>Location is a CoreData entity and placemark is one of its attributes.</p>
  
  <p>Thanks in advance.</p>
  
  <p>LocationsViewController.m</p>
  
  <pre><code>#import "LocationsViewController.h"
  #import "Location.h"
  
  @interface LocationsViewController ()
  
  @end
  
  @implementation LocationsViewController{
      NSArray *locations;
  }
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  
      NSEntityDescription *entity = [NSEntityDescription entityForName:@"Location" inManagedObjectContext:self.managedObjectContext];
      [fetchRequest setEntity:entity];
  
      NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES];
      [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
  
      NSError *error;
      NSArray *foundObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&amp;error];
      if (foundObjects == nil) {
          FATAL_CORE_DATA_ERROR(error);
          return;
      }
  
      locations = foundObjects;
  
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      locations = nil;
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  
      // Return the number of rows in the section.
      return [locations count];
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Location"];
  
      UILabel *descriptionLabel = (UILabel *) [cell viewWithTag:100];
      descriptionLabel.text = @"If you can see this";
  
      UILabel *addressLabel = (UILabel *)[cell viewWithTag:101];
      addressLabel.text = @"%@ %@, %@",
      location.placemark.subThoroughfare, // Use of undeclared identifier 'location'
      location.placemark.thoroughfare, // Use of undeclared identifier 'location'
      location.placemark.locality ]; // Use of undeclared identifier 'location'
  
      return cell;
  }
  
  
  
  @end
  </code></pre>