Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-20-2009, 09:02 PM   #1 (permalink)
gabacus
Registered Member
 
Join Date: Mar 2009
Posts: 175
Default setAnimationDuration... its just not happening...

hello all

i am trying fade a view in and out... which is simple in concept... but for some reason my code fires instantaneously rather than taken the specified amount of time to animate the transition. here is my code

Code:
- (void) fadeIn {
	[[self myView] setAlpha:0.0];
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:2.0f];
	[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
	[UIView setAnimationBeginsFromCurrentState:YES];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDidStopSelector:@selector(fadeOut)];
	
	[[self myView] setAlpha:0.8];
	
	[UIView commitAnimations];
}

- (void) fadeOut {
	NSLog(@"fadeOut called"); // just a marker so i can see if this is being called after 2 seconds
}
my problem is when fadeIn is called, the alpha is immediately set to 0.8 and fadeOut is called (i can see the nslog statement pop up as soon as i see the view)

any idea's as to why this is happening?
__________________
-- Current Apps --
Musicopoulos
gabacus is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,296
Threads: 39,091
Posts: 171,393
Top Poster: smasher (2,575)
Welcome to our newest member, Issue
Powered by vBadvanced CMPS v3.1.0

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