在一个应用程序中,我声明了一个类别`
#import <Foundation/Foundation.h>
@interface UIImage (StackBlur) // Expected method body
- (UIImage*) stackBlur:(NSUInteger)inradius ;
-(UIImage*)mergeImage:(UIImage*)firstImage eggShape:(UIImage*)secondImage rect:(CGRect)rect;
-(UIImage*)maskImage:(UIImage*)firstImage ;
@end
it shows error at commented line. Please help. here is implementation code
#import "UIImage+StackBlur.h"
@implementation UIImage (StackBlur)
- (UIImage*) stackBlur:(NSUInteger)inradius
{
return finalImage;
}
-(UIImage*)mergeImage:(UIImage*)firstImage eggShape:(UIImage*)secondImage rect:(CGRect)rect {
return theImage;
}
- (UIImage*) maskImage:(UIImage *)image {
return theImage;
}
@end
`
答案 0 :(得分:3)
UIImage
是UIKit
的一部分,因此#import <UIKit/UIKit.h>
而不是<Foundation/Foundation.h>
:
#import <UIKit/UIKit.h>
@interface UIImage (StackBlur)
- (UIImage*) stackBlur:(NSUInteger)inradius ;
-(UIImage*)mergeImage:(UIImage*)firstImage eggShape:(UIImage*)secondImage rect:(CGRect)rect;
-(UIImage*)maskImage:(UIImage*)firstImage ;
@end