Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在不使用QCView和QCPatchController的情况下观察石英成分的公布值_Objective C_Quartz Composer - Fatal编程技术网

Objective c 在不使用QCView和QCPatchController的情况下观察石英成分的公布值

Objective c 在不使用QCView和QCPatchController的情况下观察石英成分的公布值,objective-c,quartz-composer,Objective C,Quartz Composer,我一直在寻找一些控制Quartz合成的方法,将其作为从NSView继承的自定义视图的子层加载 NSString * compositionPath = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"qtz"]; QCCompositionLayer *myQCCompositionLayer = [[QCCompositionLayer compositionLayerWithFile:compositionPath] retai

我一直在寻找一些控制Quartz合成的方法,将其作为从NSView继承的自定义视图的子层加载

NSString * compositionPath = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"qtz"];
QCCompositionLayer *myQCCompositionLayer = [[QCCompositionLayer compositionLayerWithFile:compositionPath] retain];
// Borderless window with custom view
[[self.contentView layer] addSublayer: myQCCompositionLayer];
我手动发现,以下代码可用于设置已发布的输入值:

[myQCCompositionLayer setValue:@"123" forInputKey:@"published_text_input"];
所以我试图找到一种方法来观察发布的输出值,我想知道观测者是否应该这样做。写了这样的东西:

[myQCCompositionLayer addObserver:self forKeyPath:@"published_output_value" options:0 context:nil];
在同一个班级里:

- (void) observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object
                     change:(NSDictionary*)change context:(void*)context
{
    NSLog(@"123");
}
但它不起作用。可能keypath不正确,或者此代码根本不应该工作:)
那么,有什么方法可以观察我作品的出版价值吗?
谢谢你的帮助