Vuo Framework convert Json_object to NSDictionary

What’s the best way to convert a json_object to a NSDictionary?

I know I can convert it to a c-String then bridge that to a NSString then make NSData with NSJSonSerialization. Then deccode to cocoa object with NSJSonSerialazrion again.

But wondering if the is an easier way?

It was easy using the VuoRunnerCocoa as it would just give me the port details as an NSDictionary but I’m trying to use the VuoCompiler class.


Assuming this is related to your earlier question about “menuItems” — here’s how we parse that in VuoRunnerCocoa.

Some other conversion between JSON and Cocoa objects happens in the VuoRunnerCocoa+Conversion category.

1 Like

Thanks I will definitely adopt that code.
I just need to adopt it for
VuoCompilerGraphvizParser <VuoPublishedPort *>
Since based on your points I’m trying to learn the graphVizCompiler 1st and 2nd the VuoRunner.

Yeah i’m trying to convert the ports details json_object to a NSDictionary. I will probably adopt the function to accept a json_object.

I was using a string/NSJsonSerialiation but definitely running into some deeper pointer issues.

Espically regarding the defaultValue when it come something like from the WaveMenu. If the default is “sine”. It’s returning a tagged pointer string. Which after some research does not like to be asked for its “stringValue”. Also having issues when trying to bind a UI element to this pointer.

Thanks for all your help  

1 Like