Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

salvadormg

macrumors member
Original poster
Aug 19, 2009
35
0
Hi,

I'm really new to programming and i have my app like 90% complete even testing it on my iPod, it works great, but i need an info page, and thats a problem because i don't no how to get it back to main screen, i found the code to bring up the info screen when pressing the default info button from interface builder but i have no idea how to get the screen back from the info plane to my app again, does anyone have code to do this? It would really be appreciated, i can't seem to find it anywhere, (i think people just assume if you know how to get the info screen you know how to get back out of it again.... i don't :()

Thanks guys...

P.S The code i am using to get the info screen is...

- (IBAction)infoButtonPressed:(id)sender;
{
SecondViewController *second = [[SecondViewController alloc] initWithNibName:nil bundle:nil];

second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:second animated:YES];

[second release];
}
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
Code:
[self dismissModalViewControllerAnimated:YES];

Apple's supplied documentation should be your best friend while coding. in XCode, if you hold the Option key while clicking on a method name (like presentModelViewController), if the method exists, or isn't written incorrectly, you'll be taken directly to documentation about that method. try it. you'll be directed to UIViewController Class Reference, scroll thru the tasks and you'll see that finding dismissModelViewControllerAnimated is very simple. the documentation certainly can seem a bit confusing at first, but once you get use to it you'll wonder how you ever managed without it.
 

salvadormg

macrumors member
Original poster
Aug 19, 2009
35
0
Code:
[self dismissModalViewControllerAnimated:YES];

Apple's supplied documentation should be your best friend while coding. in XCode, if you hold the Option key while clicking on a method name (like presentModelViewController), if the method exists, or isn't written incorrectly, you'll be taken directly to documentation about that method. try it. you'll be directed to UIViewController Class Reference, scroll thru the tasks and you'll see that finding dismissModelViewControllerAnimated is very simple. the documentation certainly can seem a bit confusing at first, but once you get use to it you'll wonder how you ever managed without it.


Sounds interesting, i didn't no that!! I'll have a look and see can i find it now...
 

salvadormg

macrumors member
Original poster
Aug 19, 2009
35
0
I have made my app in the main window.Xib and it works and all... Should i have made it in the view controller??? because i can not get the info button to work now, i think it is looking for the button in view controller not main window...?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.