我有mainClass
和subClass
。
主类.h:
@interface mainClass : NSOpenGLView {
NSBitmapImageRep *repG;
}
@property (nonatomic, retain) NSBitmapImageRep *repG;
@end
主类.m:
#import "mainClass.h"
@implementation mainClass
@synthesize repG;
.....
-(void)setBitmapRepresentation {
repG = [[NSBitmapImageRep alloc] initWithCIImage:someMyImage];
}
@end
子类.h
#import "mainClass.h"
@interface subClass : mainClass {
CIImage *someInputImage;
CIFilter *myFilter;
}
@end
子类.m
#import subClass.h
@implementation filteringFrontLayer
.......
-(void)setInputImageForFilter {
someInputImage = [[CIImage alloc] initWithBitmapImageRep:repG];
[myFilter setValue:someInputImage forKey:@"inputImage"];
}
它不起作用。它返回空的 CIImage ( Invalid parameter not satisfying: ciImage != nil
)。如何在我的子类中访问repG
(位图数据)及其值(值在 mainClass 中设置)?