为什么我得到'No -renderInContext:找到方法'警告? [英] Why do I get 'No -renderInContext: method found' warning?

查看:94
本文介绍了为什么我得到'No -renderInContext:找到方法'警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在-renderInContext上收到编译器警告:

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; 
}

我在项目框架中有QuartzCore,代码可以工作。
如何修复代码以便停止向我发出警告?

I have QuartzCore in the project frameworks, and the code works. How do I fix the code so it stops giving me the warning?

我得到的确切警告是

warning: no '-renderInContext:' method found
warning: (Messages without a matching method signature
warning: will be assumed to return 'id' and accept
warning: '...' as arguments.)


推荐答案

尝试将Quartz框架导入您的应用程序。

Try importing the Quartz framework into your application.

然后添加,

#include< QuartzCore / QuartzCore.h>

到你的申请。

这篇关于为什么我得到'No -renderInContext:找到方法'警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆