Questions tagged [jsonmodel]

JSONModel is a library which allows rapid creation of data models on iOS, macOS, watchOS and tvOS. JSONModel introspects your model classes and the structure of your JSON input and reduces the amount of code you have to write. This tag is NOT related to "JSONModel" in SAPUI5!

JSONModel is a library which allows rapid creation of data models. JSONModel introspects your model classes and the structure of your JSON input and reduces the amount of code you have to write.

It works for iOS, macOS, watchOS and tvOS.

https://github.com/icanzilb/JSONModel

166 questions
0
votes
1 answer

Converting jsonarray (having different type) to model array using JSONModel Library

I have one problem in converting JSON array to model. I am using JSONModel library. @protocol PTTemplateModel @end @protocol PTProfileTemplateModel @end @protocol PTCategoryTemplateModel @end …
Alok Rao
  • 162
  • 1
  • 12
0
votes
1 answer

archive UIImage with JsonModel

the situation is here: I use JsonModel to convert json to model when I get data from API, it's pretty good. and I have to do persistent storage for some data, I finally choose NSKeyedArchive and NSKeyedUnarchive to save and fetch data. now comes the…
childrenOurFuture
  • 1,889
  • 2
  • 14
  • 23
0
votes
1 answer

How to do enumerateObjectsUsingBlock-like stuff with JSONModelArray?

I use JSONModel to hold my app datasource, and use -(id)initWithArray:(NSArray *)array modelClass:(Class)cls generated an JSONModelArray, now I want to do some search stuff like enumerateObjectsUsingBlock: method does. But I found that…
Allen
  • 6,745
  • 5
  • 41
  • 59
0
votes
1 answer

Using JSONModel to parse array of custom models in Swift

I am using JSONModel for creation of complex data models. I have recently migrated to swift and face difficulties during parsing an array of custom data models. class ABCDomain: JSONModel { var sampleBool : Bool! var sampleArray : Array…
vivin
  • 992
  • 1
  • 8
  • 24
0
votes
2 answers

Generic Type JSON model

this question may be trivially easy or quite hard. I do not really know Objective-C as a language but am trying to build an iPhone app anyway. I looked at JSON Model as a potential automagic data binding library for converting JSON objects into my…
mistahenry
  • 8,554
  • 3
  • 27
  • 38
0
votes
3 answers

JSONModel NSArray ConvertOnDemand

How can I create a ConvertOnDemand 'NSArray *' using the JSONModel library from the following JSON response: - [ {"id": 1, "name": "jim"}, {"id": 2, "name": "lovy"} ] Please check here if you want to know more JSONModel ConvertOnDemand…
aprofromindia
  • 1,111
  • 1
  • 13
  • 27
0
votes
1 answer

JSONModel + copmlex object

I have some problem with this library and my objects,I have 3 kind of object: page, widget, gallery page: int string dictionary of widget widget: int string dictionary gallery gallery int string array page I create all protocol so I create…
francesco.venica
  • 1,703
  • 2
  • 19
  • 54
0
votes
1 answer

Cookies handling with JSONModel/JSONHTTPClient in iOS

In my current project I am using, +(void)postJSONFromURLWithString:(NSString*)urlString params:(NSDictionary*)params completion:(JSONObjectBlock)completeBlock; method to create account and log in my application for the very first time . For second…
Sauvik Dolui
  • 5,520
  • 3
  • 34
  • 44
0
votes
1 answer

IOS : JSONModel : NSInvalidArgumentException

I've this json Data {"data": [{"id": 3,"nameAr": "Test","nameEn": "Test","active": 1, "subCategories": [{"id": 27,"nameAr": "Test", "nameEn": "Test","active": 0, "sections": [{"id": 53,"nameAr": "Test", "nameEn": "Test","active": 0}, {"id":…
ahmed Shoeib
  • 254
  • 6
  • 22
0
votes
2 answers

HTTP PUT or DELETE request with JSONHTTPClient in iOS and OS-X

I have just started working with JSONModel. JSONHTTPClient can handle asynchronous network request supporting "GET" and "POST" methods. Is there a way out to make a "PUT" or "DELETE" request using JSONHTTPClient?
Sauvik Dolui
  • 5,520
  • 3
  • 34
  • 44
0
votes
1 answer

Including properties with nil values when serializing with JSONModel

I am serializing a custom class in Objective-C using JSONModel. The class User that I am trying to serialize looks like: [UserCount]: 658 [CreationDate]: 2014-04-17T00:38:34.176Z [Credits]: 0 [Email]: Email Address [Locale]:…
Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125
0
votes
1 answer

JSONModel Generic Class

I'm currently trying to include JSONModel to a project I'm currently working on... In this project I need to get data from a web service, that always returns me same data structure, but with different entries... So I build a base JSONModel class…
Urkman
  • 1,298
  • 1
  • 16
  • 32
0
votes
1 answer

JSONMODEL iOS error JSONValueTransformer JSONObjectFrom not found

I have a fairly simple JSONModel class in .h file @class MyInnerModel; @protocol MyModel @end @interface MyModel:JSONModel @property(nonatomic,assign)NSInteger _id; @property(nonatomic,strong)NSString…
alex440
  • 1,647
  • 3
  • 20
  • 35
0
votes
3 answers

JSONModel - how to parse this file?

How to parse such a JSON using JSONModel ? [{ "Value": "Cat", "Id": 1 }, { "Value": "Dog", "Id": 2 }, { "Value": "Elephant", "Id": 3 }] if there was something like this: { animals: [{ "Value": "Cat", …
Marx Dzida
  • 61
  • 3
0
votes
2 answers

Save array of objects on the disc with JSONModel (IOS)

I read a lot of docs about this but I can't really understand how it precisely works. I would like to save my apps data in JSON format on the disc of the phone. I have a array of objects of this type: @interface ObjectA : NSObject @property…
Jeks
  • 21
  • 5