Home Game Development How to parse json in goal c xcode? – Cocos Creator

How to parse json in goal c xcode? – Cocos Creator

0
How to parse json in goal c xcode? – Cocos Creator

[ad_1]

I’m utilizing jsb.callStaticMethod to name from javascript to goal c
I name operate like this

cosnt obj={ consumer : "abc" , telephone:"1234"}
 jsb.reflection.callStaticMethod("ViewController",
                                         "callNativeDoSthing:",
                                        JSON.stringtify(obj) );

How am i able to parse json string to make use of in goal c ?

I discovered the reply

  NSError *e = nil;
   NSData *information = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
   NSDictionary *jsonDictionary = [NSJSONSerialization JSONObjectWithData: data options:  
 NSJSONReadingMutableContainers error: &e];
   NSString* consumer=jsonDictionary["user"]

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here