解雇UIImageView时无效的上下文0x0

时间:2013-11-18 01:43:02

标签: ios cocoa-touch uiimageview

当我尝试用

解雇UIImageView
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer {
    CGPoint p = [gestureRecognizer locationInView:self.view];
    if (CGRectContainsPoint(_tutorial.frame, p)) {
        _tutorial.hidden = YES;

        _transButton.enabled = YES;
        _transButtonEng.enabled = YES;
        _infoButton.enabled = YES;
        _textfield.enabled = YES;
    }
    else {
        NSLog(@"HOW IS THIS EVEN POSSIBLE?!?!?"); //The CGRect is the whole screen
    }
}

我收到此错误消息:

  

MacBook-Pro.local APP_NAME [97086]:CGContextSetFillColorWithColor:无效的上下文0x0。这是一个严重的错误。该应用程序或其使用的库正在使用无效的上下文,从而导致系统稳定性和可靠性的整体降低。此通知是礼貌的:请解决此问题。在即将到来的更新中,它将成为一个致命的错误。

它还会重复相同的消息,CGContextSetFillColorWithColor:替换为:

CGContextSetStrokeColorWithColor:
CGContextSaveGState:
CGContextSetFlatness:
CGContextAddPath:
CGContextDrawPath:
CGContextRestoreGState:
CGContextSaveGState:
CGContextSetFlatness:
CGContextAddPath:
CGContextDrawPath:
CGContextRestoreGState:
CGContextSetFillColorWithColor:
CGContextSetStrokeColorWithColor:
CGContextSetFillColorWithColor:
CGContextSetStrokeColorWithColor:
CGContextGetBlendMode:
CGContextSetBlendMode:
CGContextFillRects:
CGContextSetBlendMode:
CGContextSetFillColorWithColor:
CGContextSetStrokeColorWithColor:
CGContextGetBlendMode:
CGContextSetBlendMode:
CGContextFillRects:
CGContextSetBlendMode:
CGContextSetFillColorWithColor:
CGContextSetStrokeColorWithColor:
CGContextGetBlendMode:
CGContextSetBlendMode:
CGContextFillRects:
CGContextSetBlendMode:

我使用的是最新版本的Xcode 5和iOS 7.0.3。

我该如何解决这些错误?

1 个答案:

答案 0 :(得分:1)

隐藏_tutorial imageView后,您应该删除手势识别器(通过UIGestureRecgonizer' "removeTarget: action:" API,这样您就不会打电话给#34; {{ 1}}"在一个隐藏的视图上,谁知道帧值是什么。