views:

702

answers:

4

I'm learning this right now so the questions might be a little juvenile. Here's what I'm trying to do. I have the first view come up with a cell of the table populated statically, when you select one of the cells it will pull up a form to input data.

Now, I've been reading the documentation about navigation buttons and navigation in general and it seems that I need two separate viewControllers. One for the basic app and another for the new page being brought forward when the cell is picked. Is this correct?

Sorry, this might be a little bit basic but I'm not sure what to do here. Thanks.

+3  A: 

That is correct. You would have two view controllers: a "root" view controller that is the top-most view, and the second view controller that contains the editing form.

The second view controller would get pushed onto the navigation stack when you tap a cell.

Alex Reynolds
A: 

Yes, you need two view controllers.

Check out lesson 7 from Stanfords CS193P iPhone Application Programming course. It is available online. Both slides and the lecture through iTunes U.

CS193P iPhone Application Programming

I really enjoyed watching the course!

Niels Castle
A: 

Basically you need to create a second UIViewController subclass, this viewcontroller needs to be attached to your main window when switching views.

-(IBAction) SwitchView:(id)sender
{
MySubViewController *subViewController = [[MySubViewController] alloc]
                                         initWithNibName:@"SubView" bundle:nil];
self.view insertSubView:subViewController.view atIndex:0];
[subViewController release];
}
Mez
Is there a way to, at a later date, change the rootviewcontroler to a uiviewcontroleer subclass? Say I decide I should have another window view in front of the table view/RootViewController. How would you do that?
ckc123inDC
The root view controller that you have is already a `UIViewController` subclass. If you want another view in "front" of the root view controller, you can just add that view as a subview of the root view controller and place it on top of all the other subviews.
Alex Reynolds
A: 

Is there any programs for iPad application ?