title: Presenting a view controller modally - iPad
body: <p>I found this code to display a modal view:</p>
  
  <pre><code>- (void)add:(id)sender {
     // Create the root view controller for the navigation controller
     // The new view controller configures a Cancel and Done button for the
     // navigation bar.
     RecipeAddViewController *addController = [[RecipeAddViewController alloc]
                         initWithNibName:@"RecipeAddView" bundle:nil];
     addController.delegate = self;
  
     // Create the navigation controller and present it modally.
     UINavigationController *navigationController = [[UINavigationController alloc]
                               initWithRootViewController:addController];
     [self presentModalViewController:navigationController animated:YES];
  
  
     // The navigation controller is now owned by the current view controller
     // and the root view controller is owned by the navigation controller,
     // so both objects should be released to prevent over-retention.
     [navigationController release];
     [addController release];
  }
  </code></pre>
  
  <p>My question is how do I implement this code (I'm going to place it in a buttonPress method)</p>
  
  <p>Do I need to define anything in my header file? The bit that confuses me is that apple on provides this and no header file so i cant tell if anything should be there?</p>
  
  <p>The code refers to RecipieAddViewController what do I repleace this with, "UIViewController" ?</p>
  
  <p>What do I put as the delegate in the headerfile ?   do I need to set this up anywhere else ? like with a property?</p>
  
  <p>Is there anything else I need to do once I have copid this code in my buttonPress method to make it work?</p>
  
  <p>Thanks and sorry for all the questions.</p>