У меня есть UITableView, который помещается в приложение на основе представления. он подключен должным образом, потому что я могу изначально отправить данные. Проблема в очистке таблицы. Я могу очистить NSMutableArray, но данные все еще отображаются в таблице.
-(void)logout {
NSLog(@"LOGOUT");
[friends removeAllObjects];
NSLog(@"%@", friends);
[tableView reloadData];
}
и вот ячейка для строки в пути индекса:
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithFrame:CGRectZero];
}
// Set up the cell...
NSString *cellValue = [friends objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell;
}