Thursday, August 11, 2022
HomeGame DevelopmentThe way to parse json in goal c xcode? - Cocos Creator

The way to parse json in goal c xcode? – Cocos Creator


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

cosnt obj={ person : "abc" , cellphone:"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* person=jsonDictionary["user"]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments