iOS Returning to first view

Cpagal

macrumors newbie
Original poster
May 22, 2010
4
0
I have made a four view application. Everything works pretty well. I have four viewcontrollers and have imported each viewcontroller at each view. To move from the the firstView to the secondView etc i use this code:

Code:
- (IBAction)pushButton:(id)sender {
[self presentModalViewController:secondView animated:YES];}
When I reach the fourthView I have a button and want to return to the firstView. I want to kind of loop the app if you know what i mean. The code I use to go to the first is the same:

Code:
- (IBAction)pushButton:(id)sender{
	[self presentModalViewController:firstView animated:YES];}
When the button is pressed it goes to the firstView but then when you press the button that goes to the secondView the app quits! What kind of code should i use?
 

Cpagal

macrumors newbie
Original poster
May 22, 2010
4
0
Maybe you should debug why your app is quitting first.
How am I going to debug this? I think it's a problem of hierarchy of the views and I am actually a beginner in this!
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
447
The Centennial State

Cpagal

macrumors newbie
Original poster
May 22, 2010
4
0
You actually don't help me at all! I tried to debug it looks like theres a memory leak. But I really don't know what to do! Can't you tell how I should have my views in order to move back and forth and change them and mix them, you know what I mean?