Sorry to keep "beating a dead horse" but warning newcomers, this is wayyyy outdated, it is so much easier now...
Quote:
Originally Posted by offcampus
Got a questions to expand on the tut a bit:
Is there a way to stay within this framework, and create "flipHome" method that can be used generically for many different view controllers ... for example in the following code:
This particular code works if I call it from my goWebController.m file.
However, if I want to use the same method from multiple view controllers, to just send me home to the main screen, can I change the line
Code:
[[goWebController view] removeFromSuperview];
to something like
Code:
[[sender view] removeFromSuperview];
^ I tried that specific code, but it didn't work. I am just trying to figure out all the guts of this and understand how all the pieces work together here, using the same calling method as was used in your tutorial when I click on a "back" button.
Thanks for any advice/tips/understanding you can offer!
Ok I found out. The code is now
second = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:second animated:YES];
I dismiss in second line "self" and it's working perfectly. Thank you for the help guys!!!!
A.
Ok I found out. The code is now
second = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:second animated:YES];
I dismiss in second line "self" and it's working perfectly. Thank you for the help guys!!!!
A.
This code is incorrect, though. initWithNibName:nil should be initWithNibName:@"SecondViewController"
I know it should be like initWithNibName:@"SecondViewController" but by experimenting I found out Why it is crashing. If I type initWithNibName:nil it works just fine. No crashes. If I change it back debugger stops on 4th line as written earlier above in this forum...Is it really big deal to keep "nil"? What might be the cause in this case?
I´ve created a app with about 60-70 views this way, and now I want a Tab Bar controller in each of the views. What´s the best way to accomplish this? I can post some of the files if needed.