Serialize JSONModel – How to convert custom object to JSON in iOS?

By Shakti

How to serialize a custom object with JSONModel ?

@property(nonatomic,strong) NSString<Optional> * tag_post_type;
@property(nonatomic,strong) NSString<Optional> * tag_users_type;
@property(nonatomic,strong) NSArray<Optional> * tags;
@property(nonatomic,strong) NSMutableArray<TagMediaModel*>* tag_posts;
@property(nonatomic,strong) NSMutableArray<TagLocationModel*>* locations;

I try to create a JSON file out of my custom Object with the JSONModel framework for iOS. I get the Error:

EXCEPTION: Invalid type in JSON write (TagMediaModel)

Is it not possible to create a JSON String recursively? When I call the toJSONString method I get these Errors.

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273