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

AWS Api Gateway invalid model schema

I am trying to create a model for my api. But aws returns 3x invalid model schema error, couldn't figure out the reason: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "EmailInputModel", "type":"object", "properties":{ "email":{ …
Ergun
  • 458
  • 1
  • 8
  • 21
0
votes
1 answer

Importing custom objects into multiple files

I am having a bit of a problem with importing custom objects into my viewController. I have created a Message Object that holds the json response from the server. I then created a MessageManager class, that does all of the network calls to the…
Anthony Taylor
  • 3,073
  • 3
  • 21
  • 30
0
votes
1 answer

using JSONModel with case insensitive detection

I am working with JSONModel in our group project and came across a problem when the server guys decided to change their response data from TitleCase to camelCase. For the next while, we will need to support both options so I was hoping that since we…
Darkin
  • 221
  • 2
  • 4
0
votes
1 answer

iOS JSONModel property which is correct

if Data is { "id": "10", "country": "Germany", "dialCode": 49, "isInEurope": true } someone using @interface CountryModel : JSONModel @property (assign, nonatomic) int id; @property (strong, nonatomic) NSString* country; @property (strong,…
tommyz
  • 3
  • 3
0
votes
2 answers

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

How to serialize a custom object with JSONModel ? @property(nonatomic,strong) NSString * tag_post_type; @property(nonatomic,strong) NSString * tag_users_type; @property(nonatomic,strong) NSArray *…
Shakti
  • 986
  • 12
  • 22
0
votes
3 answers

How to use JSONModel data in different ViewControllers?

I'm using JSONModel in my objective c application. I get all data to my JSONModel in a first abBarController. Then I need get this data in other viewController. I'm trying send this data to the others viewControllers like: First…
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
2 answers

Parse a dictionary of dictionaries using jsonmodel

I'm using JSONModel for working with a JSON Api and now got stuck on parsing a Dictionary of Dictionaries. { "locations": { "one": { "displayName": "Name One", "description": "Description One" }, "two": { …
PascalTurbo
  • 2,189
  • 3
  • 24
  • 41
0
votes
1 answer

iOS - JSONModel with dynamic key

I am calling a web service which returns dictionary to render the graph. Dictionary structure is {"1":0,"2":0,"8":0,"9":2,"10":3,"11":0,"12":0} The problem is keys are dynamic values like 1,2,3 etc which indicates month. Is it possible to…
V V
  • 774
  • 1
  • 9
  • 29
0
votes
1 answer

How to create a JSONModel class in Objective-C with same variable in two types?

I have a JSONModel class in Objective-C. I am initializing this with JSON returned by a server. #import "JSONModel.h" @protocol MyJsonMoodelClass @end @interface MyJsonMoodelClass : JSONModel @property (nonatomic, strong) NSNumber
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
1 answer

Date/DateTime Filters on client side JSON Model

I have a JSON model that is bound to a sap.m.Table. I am trying to filter data based on a column "Date" (bound to property[CreatedOn] of the model) which the service returns in the JSON Object Format ("/Date(timeStamp)"). The table is as…
Deepak
  • 505
  • 1
  • 9
  • 32
0
votes
1 answer

Not able to initialise a model from JSONModel. I am getting nil value

I am not able to initialise a model from JSONModel. I am using JSONModel (as after this poc the .json is huge and needs a third party library like this to take care.). My steps are as follows: Pod installed the JSONModel Create a simple model that…
Kumar Utsav
  • 2,761
  • 4
  • 24
  • 38
0
votes
1 answer

Display unique values in a sap.m.List

I'm trying to display only unique values in a List. The values are loaded from the following JSON Model and I need to populate the List with all unique names: {"Customers": [ {"name": "Customer A","age": "30"}, {"name": "Customer B","age":…
BlkJck
  • 3
  • 1
  • 4
0
votes
4 answers

JSON Model - don't add all objects in array if using method "arrayOfModelsFromDictionaries"

Here's my JSON data [{ "id": 1, "name":"Soup", "price":200, "isOK":1 }, { "id": 2, "name":"Salad", "price":100, "isOK":0 }] I have created JSONModel as follows @interface ProductModel : JSONModel @property (assign,…
Haider
  • 4,961
  • 2
  • 18
  • 25
0
votes
1 answer

How to send in postJson an array like string without "" in Objective-c?

I need send to my request server an array in parameters, but this can't be contained between "". I need send to my server the key users with the array [2, 5, 6] value like this: "users" : [2, 5, 6] I'm trying do this but I only can get the array…
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
2 answers

How to get an array type [1,2] instead of (1, 2) in Objective-c?

I'm trying to send an array in post JSONModel call. I need convett my array to NSString and send the array in format: [1, 2, 3] but when I convert this to NSString and print my array, this has the format: (1, 2, 3) NSMutableArray *array=…
user3745888
  • 6,143
  • 15
  • 48
  • 97