Iphone – How to go to Previous View? – iPhone Devlopment

iphone

I am Using a Navigation based application.
However i don't want to push a view.
I have changed present ModalViewController.
Now, I am confused – how to load previouse view.

  1. My Application's Table View – default in navigation base application
  2. On navigation controller I have added (add employee) button.
  3. On Add(employee) click i have written following code in appDelegate.m
    -(IBAction)AddClicked:(id)sender
    {
    if(self.addData==nil) // addData is a object of my next view
    {
    addData=[[AddEmpScrn alloc] initWithNibName:@"AddEmpScrn" bundle:nil] autorelease];
    }
    [self.navigationController presentModalViewController:self.addData animated:YES];
    }

This code works successfully & next Add Employee screen load perfactly.

But Now I am confused.

How to get back to previous view?
that is if a user click on "Save" or "Cancel"
it should display again the previous view…
main screen

I dont know how to solve it…

anybody please help me…

i will be thank full.

Best Answer

Have u tried using the dismissModalViewController method? should do what you are asking f or

Related Topic