有没有“更短”的写法?获得playersViewController实例似乎还有很长的路要走......
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UITabBarController *tabBarController = (UITabBarController *)window.rootViewController;
UINavigationController *navigationController = [[tabBarController viewControllers] objectAtIndex:0];
PlayersViewController *playersViewController = [[navigationController viewControllers] objectAtIndex:0];
[playersViewController.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
我正在刷新已经加载的 tableView
#pragma mark - RatePlayerViewControllerDelegate
- (void)ratePlayerViewController: (RatePlayerViewController *)controller didPickRatingForPlayer:(Player *)player
{
if (player.rating != self.requiredRating)
{
// do stuff.. in self.tableView
// refresh players tableView