0
我無法弄清楚問題是什麼,我使用了2個教程和蘋果給你的例子,但它仍然不會更新。我試圖解決這個4天現在 一些信息:我用故事板這個項目SplitViewController不更新detailView越來越絕望
Appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
splitViewController.delegate = (id)navigationController.topViewController;
return YES;
}
MasterViewController.m
作出的財產控制器(nieuwViewController )
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SearchResult *searchResult = [searchResults objectAtIndex:indexPath.row];
NSLog(@"%@",searchResult);
self.nieuwViewController.searchResult =searchResult;
}
NieuwViewController.m
- (void)setSearchResult:(SearchResult *)newSearchResult
{
if (_searchResult != newSearchResult) {
_searchResult = newSearchResult;
// Update the view.
[self updateUI];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"DETAIL VIEWDIDLOAD");
NSLog(@"%@",self.searchResult);
[self updateUI];
}
在updateUI我將所有的標籤等,但如果我登錄即得它稱爲一個時間(應用程序啓動時)
我試着viewWillAppear NSLOG,但它也被稱爲1時間..在開始,在didviewRowAtIndexPath在masterviewcontroller我試圖[self.nieuwViewController updateUI];但相同的結果...(什麼都不做) – MichaelAngelo
你是如何在MasterViewController.m中設置'nieuwViewController'的?似乎,MasterViewController不知道它。 – SAE
omg dude我忘了讓masterviewcontroller現在它的detailviewcontroller是什麼......我明白了謝謝!它只在每次選擇一行時才起作用,它將它添加到視圖中而不是刪除舊內容並添加(不知道如何解釋它) – MichaelAngelo