Reputation: 3
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
Reputation: 4585
LocationsTableViewCellController *cell = (LocationsTableViewCellController *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
Don't need brackets.
Upvotes: 2