Recognition of QA framework from Cocoa app

Is there a way to implement the structure from a Cocoa application? I can set integers and strings using the QCView: setvalue method for the key, but when I try to access the structure, I encounter errors. Basically what I want to do is pass an array of bytes to the quartz composition.

Hi

Matthias

+4
source share
2 answers

To provide composition structure, pass an NSDictionary or NSArray to -setValue:forKey:

For example, if you start with the Xcode "Quartz Composer Application" template, you can add the following code to the AppController -changeColorToBlue: method:

 [qcView setValue:[NSDictionary dictionaryWithObjectsAndKeys:@"value1",@"key1",@"value2",@"key2",nil] forInputKey:@"Structure"]; 

or

 [qcView setValue:[NSArray arrayWithObjects:@"a",@"b",nil] forInputKey:@"Structure"]; 
+2
source

You can do this using Swift 3.1:

 // for array qcView.setValue(["Obj1", "Obj2"], forInputKey: "Structure") // for dictionary qcView.setValue(["key1":"val1", "key2":"val2"], forInputKey: "Structure") 
0
source

Source: https://habr.com/ru/post/1301820/


All Articles