我試圖使用delegate從detailviewcontroller的masterviewcontroller中更新tableview。我從委託方法調用了reloadData,但它沒有做任何事情。我仍然無法解決這個問題。self.tableView reloadData在UISplitViewController主細節應用程序中不起作用
這是MasterViewController我的委託方法
- (void)updateScore:(DetailViewController *)controller withScore:(NSUInteger)score {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:_selectedIndexPath];
NSLog(@"%@", cell.detailTextLabel.text);
cell.detailTextLabel.text = [NSString stringWithFormat:@"Best score: %lu", (unsigned long)score];
[self.tableView reloadData];
NSLog(@"%@", cell.detailTextLabel.text);
}
從的NSLog的cell.detailTextLabel.text已更新,但您需要確保的tableview不刷新
感謝
感謝您的答覆, 但我已經做到了。因爲我需要從馬西德威數據源和委託方法,以顯示對detailviewcontroller數據的詳細信息 – taylorSWIFT