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
19
votes
0 answers

JSONModel vs github Mantle Frameworks

I am building an application that requires a lot of JSON data handling. After going over different frameworks, I am down to JSONModel (https://github.com/icanzilb/JSONModel) and github Mantle (https://github.com/github/Mantle) due to their rich…
Yas Tabasam
  • 10,517
  • 9
  • 48
  • 53
12
votes
2 answers

How to make primitive type properties Optional?

I want to make some primitive properties option in my JSONModel classes. Please see the code below. #import "JSONModel.h" @protocol GreenModel @end @interface MyModel : JSONModel @property (nonatomic, assign) NSInteger
Aruna
  • 701
  • 10
  • 26
11
votes
3 answers

NSInvalidArgumentException -[__NSCFString unsignedLongLongValue]: unrecognized selector sent to instance

While using JSONModel to parse my models I found this Exception. NSInvalidArgumentException -[__NSCFString unsignedLongLongValue]: unrecognized selector sent to instance 0x1782210c0 The problem got place inside JSONModel.m because it depends on…
7ynk3r
  • 958
  • 13
  • 17
10
votes
2 answers

NSMutableDictionary inside JSONModel - EXC_BAD_ACCESS KERN_INVALID_ADDRESS

Crashlytics reported this crash in one of my apps and I am not able to reproduce it at all, no matter what I do. This happens to about 5% of the users, so it's a pretty big deal. I'm posting screenshots with the crash report and also the methods…
stonycis
  • 466
  • 4
  • 16
8
votes
1 answer

Override Objective-C class method in Swift

I'm trying to use JSONModel in a Swift project. I would like to override the method keyMapper from JSONModel but I don't find how to override an Objective-C class method in the model class. The signature of the method…
Nonouf
  • 378
  • 2
  • 5
  • 19
8
votes
2 answers

JSONModel: json to array?

Is it possible to parse json to an array of JSONModel objects using JSONModel? Like parse json below: [{"id" : 1}, {"id" : 2}] to two JSONModel objects having property of "id".
keywind
  • 1,135
  • 14
  • 24
5
votes
3 answers

JSONModel in Swift issue

I am trying to map the json to model in Swift using JSONModel. Everything works if model doesn't have properties that are JSONModel subclasses. So in example this works, and it maps the properties successfully: class Person: JSONModel { var…
vburojevic
  • 1,666
  • 5
  • 24
  • 34
5
votes
2 answers

Swift instance variable with protocol

I have to translate the following lines of Objective-c code into swift. This is a sample from the Objective-c JSONModel-Framework where the Optional protocol provided by the Framework is applied to an instance variable of type NSString. I found a…
robbiebubble
  • 161
  • 9
4
votes
4 answers

Flutter: pub finished with exit code 255

I am making models for my flutter application via build runner,json model and json serializable. But i got this error Unhandled exception: RangeError (index): Invalid value: Valid value range is empty: 0 #0 _StringBase.[]…
Umair
  • 1,759
  • 6
  • 23
  • 44
4
votes
1 answer

JSONModel and Swift Array

Is it possible to use an array in a subclass of JSONModel in Swift? Or is it a limitation as it is not updated yet? If I do this in Objective-C, in the .h file: @interface RecommendationModel : JSONModel @property (strong, nonatomic)…
Fernando
  • 1,323
  • 2
  • 12
  • 17
4
votes
1 answer

JSONModel with MagicalRecord

MagicalRecord is a nice library to manage coredata.In my application I have to processes json from web service for managing Json we are using JSONModel. Now the problem is I have to use two separate class to manage magical record and jsonModel. Is…
Eldhose
  • 726
  • 8
  • 19
4
votes
2 answers

JSONModel Bad property protocol declaration?

i have a problem in reading JSON by JSONModel library…
Tux Dawwas
  • 78
  • 1
  • 8
3
votes
3 answers

What benefits do I get from using ODataModel vs. JSONModel?

I'm reading data from HANA using a JSONModel and simply passing in the URL to the source and retrieving it as in the following: var data = new sap.ui.model.json.JSONModel(urlPath); Then I can bind it to my view: this.getView().setModel(data); I…
polaris
  • 339
  • 2
  • 14
  • 33
3
votes
2 answers

JSONModel - Assign value of JSONModel property using other properties in same JSONModel

Here's my JSON data [{ "id": 1, "name":"Soup", "price1":100, "price2":10, }, { "id": 2, "name":"Salad", "price1":100, "price2":10, }] I created JSONModel as follows @interface ProductModel : JSONModel @property…
Haider
  • 4,961
  • 2
  • 18
  • 25
3
votes
3 answers

parse json using JsonModel

Facing problem while getting a array of json. I am using JsonModel library for json handelling. My json data is: [ { "TSCard_id": 100, "TSCardBackend_id": "TSu1t1", "TSCard_date": "10/11/2013", …
Preetam Jadakar
  • 4,479
  • 2
  • 28
  • 58
1
2 3
11 12