2011-09-03 40 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>,並將該框架添加到您的項目。