我有mainClass
和subClass
。
mainClass.h:
@interface mainClass : NSOpenGLView {
NSBitmapImageRep *repG;
}
@property (nonatomic, retain) NSBitmapImageRep *repG;
@end
mainClas.m:
#import "mainClass.h"
@implementation mainClass
@synthesize repG;
.....
-(void)setBitmapRepresentation {
repG = [[NSBitmapImageRep alloc] initWithCIImage:someMyImage];
}
@end
subClass.h
#import "mainClass.h"
@interface subClass : mainClass {
CIImage *someInputImage;
CIFilter *myFilter;
}
@end
subClass.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
)。如何在我的子类中使用其值(在mainClass中设置值)访问repG
(位图数据)?
答案 0 :(得分:0)
您还可以使用其访问者访问该媒体:
someInputImage = [[CIImage alloc] initWithBitmapImageRep:[self repG]];