开发者

XCode 4 - Warning for - (void)renderInContext:(CGContextRef)ctx

开发者 https://www.devze.com 2023-04-01 22:42 出处:网络
I have this code: + (UIImage*) someImageMethod:(UIImage*)originalImage { UIImageView *tempImageView = [[UIImageView alloc] initWithImage:originalImage];

I have this code:

+ (UIImage*) someImageMethod:(UIImage*)originalImage {
    UIImageView *tempImageView = [[UIImageView alloc] initWithImage:originalImage];

    UIGraphicsBeginImageContext(tempImageView.frame.size);
    CGContextRef context = UIGraphicsGetCurrentContext();

    ...    

    [tempImageView.layer renderInContext:context];

 开发者_如何学C   ...    
}

This generates a persistent warning: No '-RenderInContext' method found.

Why such an error? How may I make it disappear?


Be sure you #import <QuartzCore/QuartzCore.h>, and add the framework to your Project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号