0

Please help me. I have "View Controller(VC) 1" + button "End" and VC 2 I want to end "VC 1" and Switch to VC2 when I touch a button "End". I tried searching online but only "Switch view"... but SWITCHING isn't ENDING

Trinh
  • 65
  • 1
  • 9

1 Answers1

3

What do you mean by end a view controller?

If you want to pop it off a navigation controller, you can use

[self.navigationController popViewController];

If you want to forcefully close your app (this will get it rejected) use

exit(0);

EDIT:

Now you have somewhat improved your question, I can tell you that this question provides a good overview on switching views.

The top answer uses code from a book called "Beginning iPhone Development" which I would highly recommend if you are just starting out with iPhone Programming.

Community
  • 1
  • 1
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
  • Thank for your answer./ I want to END VC 1 and go to VC 2... but not close my app/ and not use popover/ – Trinh Dec 28 '11 at 01:16