So, I have this code:
timer = [NSTimer scheduledTimerWithTimeInterval:4.0 target:self selector:@selector(a) userInfo:nil repeats:YES];
This code, repeat the action “a”:
-(void)a {
self.img.image = [UIImage imageNamed:[NSString stringWithFormat:@"wp%@.jpg", i]];
if([i isEqualToNumber:[NSNumber numberWithInt:1]]){
i = [NSNumber numberWithInt:2];
}else if([i isEqualToNumber:[NSNumber numberWithInt:2]]){
i = [NSNumber numberWithInt:3];
}else if([i isEqualToNumber:[NSNumber numberWithInt:3]]){
i = [NSNumber numberWithInt:1];
}
}
This void change the image “img”, using the “i” value. I want when changing image, an effect is shown, like blurring and deblurring the “img”.
Any idea how to do this effect?
Thanks for the attention,
Alberto
First, it seems it would make sense to use an
NSIntegerorintfori. You could then write much more economically:Don’t forget to change your format string to
@"wp%i.jpg".The animation would then be done like this: