Internally, structures are represented by an object that can be treated either
as an array or dictionary. When you're getting a structure into your plugin,
you shouldn't rely on it being one or the other, however it looks like we could
do something better when the structure does have keys. Writing a writing a bug
to make sure that it outputs as a dictionary if it has keys would be helpful to
us.
Troy
On Jun 29, 2010, at 3:12 PM, Michal Antonic wrote:
> I also witnessed this behavior and would like to know why, too.
>
> Miso
>
> On 29.6.2010, at 23:55, fsk wrote:
>
>> im making a custom plugin that has a structure input port (array). when i
>> send it an array of dictionaries, the dictionaries become arrays. Why is
>> that?
>>
>>
>> NSArray *myMessages=self.inputMessages;
>> int numberOfMessages=[myMessages count];
>> for(int i=0;i<numberOfMessages;i++)
>> {
>> NSDictionary *myMsg=[myMessages objectAtIndex:i];
>> [midiManager sendMsg:[VVMIDIMessage createFromVals:
>> (Byte)[[myMsg objectForKey:@"type"] integerValue]&255:
>> (Byte)[[myMsg objectForKey:@"channel"]
>> integerValue]&15:
>> (Byte)[[myMsg objectForKey:@"data1"] integerValue]&127:
>> (Byte)[[myMsg objectForKey:@"data2"] integerValue]&127]
>> ];
>>
>> }
>>
>> this throws an exception because NSCFArray does not respond to the
>> objectForKey selector.
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Quartzcomposer-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/quartzcomposer-dev/misoantonic%40gmail.com
>>
>> This email sent to [email protected]
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/tkoelling%40apple.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]