我正在使用包含以下扩展的第 3 方类:
@interface BaseClass ()
{
int privateMember;
}
@end
我创建了自己的子类:
@interface SubClass : BaseClass {
}
@end
有没有办法在 SubClass 中访问 privateMember?
编辑:实际代码
GPUImageMovie.m:(基类)
@interface GPUImageMovie ()
{
BOOL audioEncodingIsFinished, videoEncodingIsFinished;
GPUImageMovieWriter *synchronizedMovieWriter;
CVOpenGLESTextureCacheRef coreVideoTextureCache;
AVAssetReader *reader;
}
MultiTrackGPUImageMovie.h(子类)
@interface MultiTrackGPUImageMovie : GPUImageMovie {
}
...
@end
MultiTrackGPUImageMovie.m(子类)
- (void)processMovieFrame:(CMSampleBufferRef)movieSampleBuffer forTarget:(int)targetToSendIdx {
...
CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, coreVideoTextureCache, movieFrame, NULL, GL_TEXTURE_2D, GL_RGBA, bufferWidth, bufferHeight, GL_BGRA, GL_UNSIGNED_BYTE, 0, &texture);
...
}
给出错误使用未声明的标识符'coreVideoTextureCache'