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
3
votes
1 answer

Error after trying to serialize with JSONModel: Invalid type in JSON write (...)

i'am trying to serialize my object with the Framework JSOSNModel. But i am getting the following error: [JSONModel.m:915] EXCEPTION: Invalid type in JSON write (DienstleistungModel) Here is my Sourcecode: buchung.m -(NSMutableArray *)…
Eray Geveci
  • 1,099
  • 4
  • 17
  • 39
3
votes
2 answers

JSONModel and OData

We're currently evaluating JSONModel for our iOS app and are liking it very much so far. The thing is, we have to deal with an OData API which tends to overcomplicate things in a couple of places. For instance, when getting back a list of entities,…
Tobi Kremer
  • 618
  • 6
  • 22
2
votes
1 answer

SAPUI5 bind JSON Model consisting of objects to sap.m. Table

I have a problem binding my JSON Model to a sap.m.table. The model itself gets generated through an array which itself gets filled throughout the code and in the end it consists of different objects. Here's a screenshot of the object data: That…
sonja
  • 924
  • 1
  • 21
  • 52
2
votes
1 answer

How should I parse array of array of object in Objective C using JSONModel?

I have a json object which contains array of array of object. I need to parse it using JSONModel. Eg of json: { "object": [ [ { "a": 1, "b": 2 }, { "c": 1, …
KMR
  • 265
  • 3
  • 9
2
votes
1 answer

Using Objective-C JSONModel with an array of objects as entry point

I got a json objects which starts with an array of objects. I wanna use JSONModel together with this json object but I can't find an example how to do this. Here's my json: { "days": [{ "date": "2016-12-22T00:00:00.000Z", "items": [{ ...…
PascalTurbo
  • 2,189
  • 3
  • 24
  • 41
2
votes
1 answer

Serialize a custom object with JSONModel

I try to create a JSON file out of my custom Object with the JSONModel framework for iOS. I get the Error: -[JSONModel.m:1077] EXCEPTION: Invalid type in JSON write (RegisterBuyerDataOption) -[JSONModel.m:1077] EXCEPTION: Invalid type in JSON write…
tuvok
  • 679
  • 5
  • 16
2
votes
2 answers

How to parse json with JSONModel with not known keys

I'm using JSONModel library in my iOS project, I need to manipule an object which is made of arbitrary keys and values. I didn't find anything about this problem anywhere ... How can I manage to map unknown keys ?
Frntz
  • 2,395
  • 2
  • 16
  • 16
2
votes
3 answers

How to pass JSON dictionary as parameter using JSON Model by Post method?

I want to pass a JSON dictionary as a parameter by using uploadUrl, but it gives me an Unsupported Url error with code-1002. When I hit this URL on Postman, it works perfectly. How do I implement this using a JSON model? NSString *uploadUrl =@"
Sourabh Sharma
  • 8,222
  • 5
  • 68
  • 78
2
votes
2 answers

Dynamic model cascading based on property with JSONModel

Given the following JSON blob: [ { type: "audio", title: "Audio example title", }, { type: "video", title: "Video example title", }, { type: "audio", title: "Another audio example title", }, ] and two JSONModel…
Tobi Kremer
  • 618
  • 6
  • 22
2
votes
2 answers

JSONModel not working with Swift arrays

I am having some trouble using JSONModel in Swift. I am trying to create a ToDo list app that would persist a collection of items so that the ToDo items are preserved when the app is closed. This is the code I use: class ToDoItem: JSONModel { …
Sterbic
  • 213
  • 5
  • 15
2
votes
1 answer

About JSONModel, how can i make primitive type property Optional?

I am using JSONModle, but i meet a problem, i am not sure how can i handle it? @interface MessageModel : JSONModel @property(nonatomic, strong) NSString* create_at; @property(nonatomic, assign) long …
BlackMamba
  • 10,054
  • 7
  • 44
  • 67
2
votes
3 answers

JSONModel iOS and Polymorphism

Using the following models as examples, what are the best practices of handling polymorphism within JSONModel? @interface GameModel : JSONModel @property (nonatomic, assign) long id; @property (nonatomic, assign) NSArray *events; /* …
Leon Storey
  • 3,274
  • 2
  • 25
  • 40
2
votes
2 answers

JSONModel: Filling an NSArray of generic type

I'm using JSONModel in my iOS app and i'm facing some warnings, let me explain myself a bit. Let's say i have this JSONModel CTVContact.h @interface CTVContact : JSONModel @property (nonatomic, strong) NSArray
albertosh
  • 2,416
  • 7
  • 25
  • 32
2
votes
1 answer

JSONModel returns nil

I'mm using JSONModel to get the JSON from the URL. It's a very simple object, containing only 2 strings - "name" and "url". First I made the Object Model: @protocol Tutorial @end @interface Tutorial : JSONModel @property (nonatomic, strong) …
SteBra
  • 4,188
  • 6
  • 37
  • 68
2
votes
3 answers

How to serialize an NSArray to JSON using JSONModel

Strangely, there doesn't appear to be any public method to serialize an array, yet it can obviously do it when serializing an array property. I have a JSONModel-inherited class with an array property. I want to get a JSON textual representation of…
devios1
  • 36,899
  • 45
  • 162
  • 260
1
2
3
11 12