2011-09-03 89 views
2

我有这样的代码:的XCode 4 - 警告为 - (空)renderInContext:(CGContextRef)CTX

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

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

    ...  

    [tempImageView.layer renderInContext:context]; 

    ...  
} 

这会产生一个持续提醒:No '-RenderInContext' method found.

为什么这样的错误?我如何让它消失?

回答

4

确保你的#import <QuartzCore/QuartzCore.h>,并将该框架添加到您的项目。