Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, so I'll just explain to you what you're doing wrong first:</p> <pre><code>// You're not allocating the view here. AddProjectViewController *nextController = addProjectViewController; // When allocated correctly above, you can simple push the new controller into view [self.navigationController pushViewController: (UIViewController *)addProjectViewController animated:YES]; </code></pre> <p>The pushed view controller will automatically inherit super's (the view controller that's pushing it) navigation bar (which means you can make calls on self.navigationController in the child view controller, since UINavigationController is simply a subclass of UIViewController (and so is UITableViewController).</p> <p>Here's what you need to do:</p> <pre><code>// Allocate AddProjectViewController AddProjectViewController *addProjectViewController = [[AddProjectViewController alloc] init]; // Adds the above view controller to the stack and pushes it into view [self.navigationController pushViewController:addProjectViewController animated:YES]; // We can release it again, because it's retained (and autoreleases in the stack). You can also choose to autorelease it when you allocate it in the first line of code, but make sure you don't call release on it then! [addProjectViewController release]; </code></pre> <p>However, for what you're trying to do, it would be much better to present the view controller modally, which means you will have to hold it inside a navigation controller. Here's how:</p> <pre><code>// Allocate AddProjectViewController AddProjectViewController *addProjectViewController = [[AddProjectViewController alloc] init]; // Create a navigation controller UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addProjectViewController]; // Release the view controller that's now being retained by the navigation controller [addProjectViewController release]; // Adds the above view controller to the stack and present it modally (slide from bottom) [self presentModalViewController:navigationController animated:YES]; // Release the navigation controller since it's being retained in the navigation stack [navigationController release]; </code></pre> <p>Note that you need to create UIBarButtonItems in your AddProjectViewController class.</p> <p>I have updated your code and uploaded it here: <a href="http://dl.dropbox.com/u/5445727/Zum.zip" rel="noreferrer">http://dl.dropbox.com/u/5445727/Zum.zip</a></p> <p>Hope it helps, you'll need to look at the comments here, I didn't transfer them to your project. Good luck :)</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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