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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 11-05-2010, 01:26 AM   #12 (permalink)
aoberoi
Registered Member
 
Join Date: Aug 2008
Posts: 11
aoberoi is on a distinguished road
Default

Quote:
Originally Posted by Bertrand21 View Post
Code:
// get the view that's currently showing
	UIView *currentView = self.view;
	// get the the underlying UIWindow, or the view containing the current view view
	UIView *theWindow = [currentView superview];
	
	// 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:kCATransitionFromLeft];
	[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
	
	[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
I have a couple questions about memory management using this code.

Assuming this is a method inside a UIViewController, when does this object get released? Its view isn't in the window anymore so it should be save to release right?

Who is retaining the newView's view controller? Where is it alloc-init-ed? If I want to initialized it from a nib, then load the view this way, will the view controller stick around beyond the end of this method?
aoberoi is offline   Reply With Quote
 

» Advertisements
» Online Users: 432
12 members and 420 guests
Code.ei, dansparrow, dinoclaud, erdinc27, EvilElf, ilmman, JavierEPease, n00b, poke, raymng, Speed, Warblr
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,590
Threads: 94,083
Posts: 402,777
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JavierEPease
Powered by vBadvanced CMPS v3.1.0

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