I have code as below to do UIView animation, but I found that doesn't work in iOS6, I tried to use block but unsuccessful, does anyone help me?
Code:
- (void)animationDidStop:(NSString*)animationID finished:(NSNumber*)finished context:(void*)context {
UIView* backView = (UIView*)context;
[backView removeFromSuperview];
[backView release];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIImage* backImage = [UIImage imageNamed:@"Default.png"];
UIView* backView = [[UIImageView alloc] initWithImage:backImage];
backView.frame = window.bounds;
[window addSubview:backView];
[UIView beginAnimations:@"CWFadeIn" context:(void*)backView];
[UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector: @selector(animationDidStop:finished:context:)];
backView.alpha = 0;
[UIView commitAnimations];
[window makeKeyAndVisible];
return YES;
}
Last edited: