Hi everyone,
I'm quiet new in ObjC and app programming. All I want to do is fade in an image. For that I did this:
-(IBAction)changeImg:(id)sender{
myImgView.image = [UIImage imageNamed:@"image.png"];
myImgView.alpha = 0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
myImgView.alpha = 1;
[UIView commitAnimations];
}
That works quiet good. But now I want to put the fade function into an own method and I don't know how to call that method:
-(IBAction)changeImg:(id)sender{
myImgView.image = [UIImage imageNamed:@"image.png"];
[myImgView fadeIn:self];
}
-(void) fadeIn:(UIImageView *) imgFade{
imgFade.alpha = 0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
imgFade.alpha = 1;
[UIView commitAnimations];
}
When I call the method like this I get a warning:"'UIImageView' may not respond to '-fadeIn:'"
Can anyone help me please?