Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There may be other ways but by far the easiest way is to use a navigation controller. In fact, it is built to do exactly this.</p> <p>If you don't want the navigationBar then you can hide it in the viewWillAppear function.</p> <pre><code>[self.navigationController setNavigationBarHidden:YES animated:YES]; </code></pre> <p>Then you can add an other UIViewController to push when the user selects a cell.</p> <p>Having read your OP again I'm not sure how you are adding your navigationController.</p> <p>To use a navigationController you create it and load it at start time. You then create your current viewController (the one with the buttons and table etc...) and set this as the rootViewController of the navigationController.</p> <p>Then you display the navigationController.</p> <p>Could you explain how you are adding your navigationController as it may help understand what is going wrong.</p> <p>Thanks</p> <p>::EDIT::</p> <p>OK, my assumption was correct.</p> <p>The way you are using the navigation controller is not how it was intended.</p> <p>OK, so at the moment your AppDelegate file will have a method Application didFinishLaunching...</p> <p>It will look something like this...</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.viewController = [[OJFViewController alloc] initWithNibName:@"MainViewController" bundle:nil]; self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>You should change it so that it is like this...</p> <p>first add a property to your appDelegate...</p> <pre><code>@property (nonatomic, strong) UINavigationController *navigationController; </code></pre> <p>Then change the didFinishLaunchingMethod to this...</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.viewController = [[OJFViewController alloc] initWithNibName:@"MainViewController" bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController]; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>This will still show you MainViewController but it will now be contained within a navigationController.</p> <p>Next in your MainViewController function <code>viewWillAppearAnimated</code> add the line...</p> <pre><code>[self.navigationController setNavigationBarHidden:YES animated:animated]; </code></pre> <p>This will then hide the navigationBar at the top of the view so you still have access to your buttons.</p> <p>The you need a new ViewController and xib file (for example DetailViewController).</p> <p>When the user selects a table row you need to then do something like...</p> <pre><code>DetailViewController *detailView = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; //pass in details of which row was selected. [self.navigationController pushViewController:detailView animated:YES]; </code></pre> <p>This will then display your new view and new viewController. You will also need to write a way of passing the data in (set up a property on the DetailViewController).</p> <p>Hope this helps.</p>
    singulars
    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