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 04-12-2010, 01:59 PM   #8 (permalink)
darkplastic
Registered Member
 
Join Date: Apr 2010
Posts: 2
Default Allowing for transitions back from target view...

Quote:
Originally Posted by erastusnjuki View Post
Just for those who are stranded like I was ...here's some code that worked for me. with this the new view slid in
//1. Add the QuatzCore Framework from library to the Frameworks folder
//2. At the top include the header file

#import <QuartzCore/QuartzCore.h>

//3. Implement the code

yourViewController = [[YourViewController alloc]
initWithNibName:@"YourViewController"
bundle:nil];
// get the view that's currently showing
UIView *currentView = self.view;
// get the the underlying UIWindow, or the view containing the current view
UIView *theWindow = [currentView superview];

UIView *newView = yourViewController.view;

// remove the current view and replace with myView1
[currentView removeFromSuperview];
[theWindow addSubview:newView];

// set up an animation for the transition between the views
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseO ut]];

[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
Hey guys, all this seems to work, just doesn't seem to create a valid reference to the new viewController.

After the transition any (IBAction) calls from the new view seem to crash the application...am I missing something here?
darkplastic is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,863
Threads: 89,223
Posts: 380,687
Top Poster: BrianSlick (7,129)
Welcome to our newest member, hermi7jami
Powered by vBadvanced CMPS v3.1.0

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