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

View Single Post
Old 09-12-2008, 07:24 PM   #14 (permalink)
varchar
Registered Member
 
Join Date: Aug 2008
Posts: 95
Default

Yes. There are many ways to push or "switch" views.

Here is way to push the view (assuming you are using navigation controller)

Code:
	MyViewController *view1 = [[MyViewController alloc] initWithNibName:@"MyView" bundle:[NSBundle mainBundle]];
	self.myViewController = view1;
	[view1 release];
	
	[self.navigationController pushViewController:self.myViewController animated:YES];

Another way would be to do the following (if your app is only view based not nav based)

Code:
MainViewController *aSecondView = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil];
	[self setMainViewController:aSecondView];
	[aSecondView release];
	
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:2.0];
	[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:window cache:YES];
	[viewController.view removeFromSuperview];
	[self.window addSubview:[mainViewController view]];
	[UIView commitAnimations];
varchar is offline   Reply With Quote
 

» Advertisements
» Online Users: 358
20 members and 338 guests
ADY, chemistry, Duncan C, fkmtc, HemiMG, her-ur, iDifferent, MarkC, marto1914, Meoz, padsoftware, Promo Dispenser, Raffaello, sneaky, sojourner, syver, tathaastu, tgjorgoski, Thrillhouse1919, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,220
Posts: 380,716
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:45 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.