I get a compiler warning at the -renderInContext:
- (UIImage *) imageFromView:(UIView *)view {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
I have QuartzCore in the project frameworks, and the code works. How do I fix the code so it stops giving me the warning?
The exact warning I get is
warning: no '-renderInContext:' method found
warning: (Messages without a matching method signature
warning: will be assumed to return 'id' and accept
warning: '...' as arguments.)
Try importing the Quartz framework into your application.
Then add,
#include <QuartzCore/QuartzCore.h>
to your application.
Do you have QuartzCore.framework in your project?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With