【发布时间】:2011-06-13 19:43:02
【问题描述】:
我在 -renderInContext 处收到编译器警告:
- (UIImage *) imageFromView:(UIView *)view {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
我在项目框架中有 QuartzCore,并且代码有效。 如何修复代码以使其不再向我发出警告?
我得到的确切警告是
warning: no '-renderInContext:' method found
warning: (Messages without a matching method signature
warning: will be assumed to return 'id' and accept
warning: '...' as arguments.)
【问题讨论】: