Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad, navigation stack in master view, select an item in master view and update detail view
    primarykey
    data
    text
    <p>I'm building my first app and have been searching around for answers but couldn't find an answer. May be it's the keywords I used in searching. So here is my problem.</p> <p>This is an iPad app (Xcode 4) with master-detail template. The master view is supposed to show a list of categories, upon selecting each category, a list of articles will be pushed to the master view (with a back button on the navigation bar to go back to the category list).</p> <p>I'm able to make it work up to here. After selecting an article, I can't seem to update the label in the detail view with the article name.</p> <p>This are my codes in AppDelegate.m:</p> <pre><code>MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; ArticlesViewController *articlesViewController = [[ArticlesViewController alloc] initWithNibName:@"ArticlesViewController" bundle:nil]; UINavigationController *articlesNavigationController = [[UINavigationController alloc] initWithRootViewController:articlesViewController]; DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController]; articlesViewController.mainDetailViewController = detailViewController; self.splitViewController = [[UISplitViewController alloc] init]; self.splitViewController.delegate = detailViewController; self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil]; self.window.rootViewController = self.splitViewController; </code></pre> <p>If I change the following line:</p> <pre><code>self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil]; </code></pre> <p>to</p> <pre><code>self.splitViewController.viewControllers = [NSArray arrayWithObjects:articlesNavigationController, detailNavigationController, nil]; </code></pre> <p>The label will be updated.</p> <p>Any pointers? I have seen tutorials on master view connecting to detail view where the master view only have one level of navigation, but can't seem to find one that simulates my situation. Again, may be I just don't know the right keywords to search.</p> <p>Thank you in advanced.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload