As the content of input structures is beyond your control (even when QC acts 
according to your expectations, users are sure to mess it up) you should use 
NSObject's introspection methods (isKindOfClass: etc) to examine structure 
inputs before calling any methods on them.

I can't however answer your question as to why... but you can NSLog(@"%@", 
[self.inputMessage description]); to examine what you're receiving

On 29 Jun 2010, at 22: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      (Quartzcomposer-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/bangnoise%40gmail.com
> 
> This email sent to bangno...@gmail.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to