Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hmmm, well it's a bit tricky without knowing the details of your implementation -- I assumed that you implemented your navigation controller as in the linked article. Also although you give no details it sounds like you've added a table view controller somewhere along the line, so I made the UIViewController conform to the UITableView protocols to handle everything in one place:</p> <p><code>@interface SOViewController : UIViewController</code>&lt;<code>UITableViewDelegate,UITableViewDataSource &gt; {</code></p> <pre> UINavigationController* navController; } - (IBAction) pushMe:(id)sender; @end </pre> <p>I dropped a button on the SOViewController's view in IB and wired the pushMe: action to it. I also created another UIViewController-based class called <code>JunkController</code> and dropped a "Junk" label on it's view in IB -- that's all I did in IB. In the SOViewController's viewDidLoad:</p> <pre> navController = [[[UINavigationController alloc] init] retain]; navController.navigationBar.barStyle = UIBarStyleBlackOpaque; navController.toolbarHidden = YES; UITableViewController* tvController = [[UITableViewController alloc] init]; UITableView* tv = [[UITableView alloc] init]; tvController.tableView = tv; tv.delegate = self; tv.dataSource = self; [navController setViewControllers:[NSArray arrayWithObject:tvController]]; </pre> <p>In the pushMe: action implementation:</p> <p><code>[self presentModalViewController:navController animated:YES];</code></p> <p>Implemented the tableView delegate and datasource methods; for selection:</p> <pre> - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"row selected"); JunkController* junk = [[JunkController alloc] initWithNibName:@"junkcontroller" bundle:nil]; [navController pushViewController:junk animated:YES]; [junk release]; } </pre> <p>This should yield an app that surfaces a screen with a "Push me" button. When that button is pressed you should get an animated modal navigation-based table view -- mine had one row in it that contained a label "select me". Touching this row should animate the junk controller into view.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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