Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed a really simple navigation controller with a table view inside a tab bar controller
    primarykey
    data
    text
    <p>I have an app with a tab bar controller (2 tabs). In one tab view controller, a button leads to an alert window. I want one button of the alert window to call a table view containing possible answers. I want that table view to have a <code>done</code> button and a <code>title</code>. I think that means a navigation controller has to be used. But most everything I can find on navigation controllers assumes a much more complicated situation. Here's part of the alert window logic:</p> <pre><code>-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 2) { AnswersViewController *aVC = [[AnswersViewController alloc] init]; [self presentViewController:aVC animated:YES completion:NULL]; } } </code></pre> <p>And <code>AnswersViewController</code> looks like this:</p> <pre><code>@interface AnswersViewController : UITableViewController @end @implementation AnswersViewController - (id) init { self = [super initWithStyle:UITableViewStylePlain]; return self; } - (id) initWithStyle:(UITableViewStyle)style { return [self init]; } - (void)viewDidLoad { [super viewDidLoad]; [[self view] setBackgroundColor:[UIColor redColor]]; } @end </code></pre> <p>This code all works as expected (an empty red <code>UITableView</code> appears).</p> <p>Two questions I guess: 1. Is there a simple modification to what I have that can give me a <code>done</code> button and <code>title</code> in my table view? 2. If I have to go to a navigation controller (probably), how can I make a bare-bones navigation controller with a <code>done</code> button and <code>title</code> and embed the table view within it? Oh, and I want to do this programatically. And I think I prefer the <code>done</code> button and <code>title</code> to be in the navigation bar, no tool bar desired. Thanks!</p>
    singulars
    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