user3240482
user3240482

Reputation: 3

Use of undeclared identifier 'cell' in TableViewCell

I don't understand why I've got this message, and how to fix it.

In my below code, every line containing "cell" gives me a message "Use of undeclared identifier 'cell'"...

   static NSString *CellIdentifier = @"LocationCell"; 
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     (LocationsTableViewCellController *)cell = (LocationsTableViewCellController *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

      Feed *feed = [_feeds objectAtIndex:indexPath.row];

      cell.phraseLabel.text = feed.title;
      //cell.detailTextLabel.text = new.place;
      //cell.imageView.image = [UIImage imageNamed:@"location.png"];

      return cell;
  }

  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section                 {
    return [_feeds count];
    }

Upvotes: 0

Views: 672

Answers (1)

Cy-4AH
Cy-4AH

Reputation: 4585

LocationsTableViewCellController *cell = (LocationsTableViewCellController *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

Don't need brackets.

Upvotes: 2

Related Questions