views:

86

answers:

1

Hi there,

is there a way of acessing a structure from a Cocoa app? I am able to set integers and Strings using the QCView setvalue:forkey method but when i try to access a structure i run into errors. Basicly what i want to do is to pass a byte array into a Quartz composition.

greetings

matthias

+1  A: 

To provide a structure to a composition, feed an NSDictionary or an NSArray to -setValue:forKey:.

For example, if you're starting with the Xcode "Quartz Composer Application" template, you could add the following code into AppController's -changeColorToBlue: method:

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

or

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