不会撒谎,我正在尝试按照书中的教程进行操作,但我无法通过此警告。
Incompatible pointer types initializing 'CGContextRef *' (aka 'struct CGContext **') with an expression of type 'CGContextRef' (aka 'struct CGContext *')
违规行是:CGContextRef *imageContext = UIGraphicsGetCurrentContext();
- (IBAction)hide:(id)sender {
CGContextRef *imageContext = UIGraphicsGetCurrentContext();
if (_myIcon.alpha == 1) {
[UIView beginAnimations:nil context:imageContext];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:3];
[UIView setAnimationDelegate:self];
_myIcon.alpha = 0.0;
[_hideButton setTitle:@"Show" forState:UIControlStateNormal];
} else if (_myIcon.alpha == 0.0) {
[UIView beginAnimations:nil context:imageContext];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:3];
[UIView setAnimationDelegate:self];
_myIcon.alpha = 1;
[_hideButton setTitle:@"Hide" forState:UIControlStateNormal];
}
[UIView commitAnimations];
}