我在-renderInContext上收到编译器警告:
- (UIImage *) imageFromView:(UIView *)view {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
Run Code Online (Sandbox Code Playgroud)
我在项目框架中有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.)
Run Code Online (Sandbox Code Playgroud)