Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials

Reply
 
LinkBack Thread Tools Display Modes
Old 07-19-2009, 08:34 PM   #76 (permalink)
Registered Member
 
jamesbrannan's Avatar
 
Join Date: Aug 2008
Location: Gaithersburg, MD
Posts: 178
Default

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 View Post
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:

Code:
- (void)flipToHome:(id)sender{
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:1.0];
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
	[[goWebController view] removeFromSuperview];
	[window addSubview:[viewController view]];
	onFront = YES;
	[UIView commitAnimations];
	
}
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!
jamesbrannan is offline   Reply With Quote
Old 07-20-2009, 06:22 AM   #77 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 22
Default

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.
alessign is offline   Reply With Quote
Old 07-20-2009, 08:12 AM   #78 (permalink)
Registered Member
 
jamesbrannan's Avatar
 
Join Date: Aug 2008
Location: Gaithersburg, MD
Posts: 178
Default

Quote:
Originally Posted by alessign View Post
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"
jamesbrannan is offline   Reply With Quote
Old 07-21-2009, 12:44 PM   #79 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 22
Default

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?
alessign is offline   Reply With Quote
Old 01-30-2010, 08:16 AM   #80 (permalink)
Dev
 
Join Date: Jan 2010
Location: Tromso/Norway
Posts: 13
Default

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.
ExibeR is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 251
24 members and 227 guests
@sandris, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, iDifferent, JasonR, mer10, Oral B, prchn4christ, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Thompson22, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,752
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:04 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0