我刚开始接触核心图形的发布,可能需要一些帮助。
我的代码看起来像这样:
UIImage *buttonImage() {
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB();
CGMutablePathRef outerPath;
CGMutablePathRef midPath;
CGMutablePathRef innerPath;
CGMutablePathRef highlightPath;
//Some button stuff
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGContextRelease(context);
return image;
}
那个发布行,我已经放进去了。但是我遇到了一个错误:
context_reclaim: invalid context
context_finalize: invalid context
有没有想法在这种情况下我应该把发布放在哪里?