You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Cordova one can call native APIs with JSON objects and they are converted to NSDictionary under the hood.
Consider the same behaviour for JSONArray <-> NSArray
The text was updated successfully, but these errors were encountered:
Right now the bridge will convert an Array to an NSArray implicitly, but that's because I can recognize the Array exotic object. I can project the Map exotic object as NSDictionary the same way, but from what I gather Maps are not what you're after.
Type-coercing exotic objects is simple, but it becomes tricky to do correctly for plain JavaScript objects. I can't guess the purpose of an object - is it array-like, is it map-like, is it javascript-framework-du-jour's idea of a date, and so on. That's why there's no implicit conversion to NSDictionary today.
What I can do is convert an Object to a NSDictionary only when the target type is explicitly NSDictionary. That is to say, if a native function or method accepts CFDictionaryRef or NSDictionary. Would that work for you?
In Cordova one can call native APIs with JSON objects and they are converted to NSDictionary under the hood.
Consider the same behaviour for JSONArray <-> NSArray
The text was updated successfully, but these errors were encountered: