거짓말하지 않으려 고합니다. 책에서 자습서를 따르려고하고 있는데,이 경고를 지나칠 수 없습니다.'CGContextRef *'를 초기화하는 호환되지 않는 포인터 유형
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];
}
현재 - 새로운 책이 필요합니다. 'UIView beginAnimations : context :'와'UIView commitAnimations'의 사용은 권장하지 않습니다. UIView의 새로운 블록 기반 애니메이션 메소드를 사용하는 것이 훨씬 낫습니다. – rmaddy
@rmaddy 저작권 2013 ... 그 짜증. – nipponese