XCODE中的预期方法体错误

时间:2012-07-20 09:07:32

标签: iphone objective-c ios cocoa-touch ios4

在一个应用程序中,我声明了一个类别`

#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

`

1 个答案:

答案 0 :(得分:3)

UIImageUIKit的一部分,因此#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