Closed jmbldwn closed 6 years ago
According to the ECMA spec,
Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol value
objc.ns
therefore will always create a NSDictionary
w/ NSString
keys. If you want some custom id
as a key, you'll have to create a NSMutableDictionary
and fill it via setObject:forKey:
Thanks. This works. It might be nice someday to have a smoother way to pull in .h files that define constants that the runtime expects, including conversion from 4BCC codes to numbers. It ends up being a little clunky to have to do this manually.
I have a property I need to set with a dictionary. The obj.ns() method says it turns objects into dictionaries, but NSDictionary keys can be more than just strings. For example to configure video output settings, in Objective C I do this:
I can't quite figure out how to construct the JS object to pass to obj.ns() to make this happen. Am I missing something?