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

Trouble saving JSON data for use by multiple UIViews

I am having a bit of trouble accessing the JSON data that I have pulled in. I am using the JSONModel to get my JSON data, like this: At the Top of my LeftViewController.m @interface LeftViewController () { PostgresFeed* _feed; } And then down…
CaptJak
  • 3,592
  • 1
  • 29
  • 50
1
vote
1 answer

Dart Json deserialization

Using flutter docs am trying to learn json deserialization. But I am getting the following error "The argument type 'Map' can't be assigned to the parameter type 'String'" heres the code import 'dart:convert'; User…
1
vote
3 answers

What is the difference between setJSON, setData and loadData?

This is regarding the mentioned methods of sap.ui.model.json.JSONModel in SAPUI5: setJSON setData loadData What is the difference between these 3 methods? When do we use these methods and can we use more than 1 of them for the same purpose?
d33a
  • 690
  • 1
  • 14
  • 39
1
vote
1 answer

How to Get Values From dynamic Id's and Pass to Controller using Ajax

function Save() { var count = $("#count").val();//count to iterate var obj = {} for (var i = 0; i < count ; i++) //iterating for each set of id's { obj = { …
1
vote
1 answer

JSONModel Compare Models with each other

I only want save the data of a Model if something of the properties has changed. Therefore I would like to compare the original and the "changed" properties with each other. Found this hint by Sergio, but without a…
user2405095
  • 113
  • 4
  • 16
1
vote
1 answer

"[__NSDictionaryI content]: unrecognized selector sent to instance" When getting data from Custom JsonModel

I have implemented following JsonModels. @interface MainModel : JSONModel @property (nonatomic) NSArray *cclSecurityChecklist; @end @interface CCLSecurityChecklistModel : JSONModel @property (nonatomic) NSString…
Nyein Ei Ei Tun
  • 168
  • 2
  • 13
1
vote
1 answer

Can I set a ModelClass in one UIViewcotroller and read the ModelClass' object from another UIViewCotroller using swift3 iOS?

I'm trying to learn to make use of ClassModels in swift3, since I couldn't find a proper tutorial to understand the basic concept, I referred to too many sites and succeeded in creating a model class and setting values to the model class' objects…
swiftDevStart
  • 81
  • 3
  • 11
1
vote
2 answers

how to parse json and fill it in model?

this is my json [ { "_id": "58b517e8dd7fe4a90fcadc44", "isActive": false, "balance": "$1,293.72", "picture": "http://placehold.it/32x32", "age": 38, "eyeColor": "brown", "name": "Finch Hayes", "gender": "male", …
1
vote
1 answer

Change event is not triggering for JSONModel

I have model called resources i need to listen to the change event i have attached the binding as below var resModel = this.getModel("resources"); var resBinding = new Binding(resModel, "resources>/resources",…
chiranjeevigk
  • 1,636
  • 1
  • 23
  • 43
1
vote
2 answers

Listener for the JSONModel for Custom Control UI5

i have a custom control which need to array of data as below properties : { scrollheight: {type : "sap.ui.core.CSSSize", defaultValue : "100%"}, array1 :{type : "Array", defaultValue : []}, array2 : {type :…
chiranjeevigk
  • 1,636
  • 1
  • 23
  • 43
1
vote
2 answers

JsonModel Mapping Issue

I am using jsonmodel for mapping my response after getting from my service. Now the problems my service is giving me the response as an array of dictionaries but I can't map the array as it is not assigned against any key. I have a JsonModel named…
Natasha
  • 6,651
  • 3
  • 36
  • 58
1
vote
2 answers

How to deserialize JSON date to NSDate in objective-c?

I have a Source date string /Date(1455895287677-0500)/ in objective-c. I need to convert it to format like "2015-01-01 HH:MM:SS" How can I convert it to Date or NSDate? I'm using JSONModel, but it seems not working.
Alex Lee
  • 161
  • 2
  • 8
1
vote
1 answer

JSONModel: Model Collection to JSON and Add Collection Manually

Lets say I have this Model. @protocol ProductModel @end @interface ProductModel : JSONModel @property (assign, nonatomic) int id; @property (strong, nonatomic) NSString* name; @property (assign, nonatomic) float price; @end @implementation…
itsaboutcode
  • 24,525
  • 45
  • 110
  • 156
1
vote
1 answer

"Bad property protocol declaration" when trying to initialize model class which is in framework

I have been stretching my head from two days to solve this issue. I have created iOS universal framework which contains my model classes derived from JSONModel. For example, @protocol XYZ @end @interface XYZ : JSONModel @property(nonatomic,strong)…
1
vote
2 answers

JSONModel Optional and Ignore are not respected

I have these properties in the header file. @property (copy, nonatomic) NSString* guidId; @property (copy, nonatomic) NSDate* created_at; @property (copy, nonatomic) NSNumber* longitude; @property (copy, nonatomic)…
George Taskos
  • 8,324
  • 18
  • 82
  • 147
1 2
3
11 12