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

JsonModel cannot convert an array in json to jsonmodel inherited class

I have modeled my api result as following: #import "PTPDestination.h" @interface PTPIndex : PTPBaseEntity @property (strong, nonatomic) NSNumber * citiesCount; @property (strong, nonatomic) NSNumber * hotelsCount; @property (strong, nonatomic)…
aakpro
  • 1,538
  • 2
  • 19
  • 53
0
votes
1 answer

jsonmodel - Model cascading (models including other models)

I'm using the same example on the web OrderModel.h @protocol ProductModel @end @interface ProductModel : JSONModel @property (assign, nonatomic) int id; @property (strong, nonatomic) NSString* name; @property (assign, nonatomic) float…
Ricardo
  • 7,921
  • 14
  • 64
  • 111
0
votes
1 answer

Possible to combine two user classes in Objective-C?

I have two classes with the same name. I am having conflicts because of that. I cannot rename because JSON Model is using that name and other reason over 100 classes are importing it . Can they be combined? Or a Solution for JSONModel? Class 1…
Rayen Kamta
  • 115
  • 1
  • 2
  • 9
0
votes
0 answers

ZF2 - JsonModel multiple messages

Good day. I have this code to make a popup message. public function transactionMessage($message = 'Some message') { $this->getResponse()->getHeaders()->addHeaderLine('Content-type', 'text/json'); $view = new JsonModel(); …
yowza
  • 260
  • 2
  • 14
0
votes
1 answer

How to pass 'mHeaders' in loadData method of JSONModel?

I need to know how to pass authorization values in sap.ui.model.json.JSONModel -> loadData() method API reference I am trying to execute this - var uri =…
Rahul
  • 143
  • 2
  • 16
0
votes
1 answer

SAPUI5 binding JSON model to control

I am an ABAPer and learning SAPUI5. I am practising master-detail application through splitApp control. I have been searching for this kind of example but did not find any. so, i am writing here. Please guide me if possible. I am using local JSON…
Lokireddy
  • 11
  • 3
0
votes
1 answer

Cocoapods update generated Errors with JSONModel

Just updated my cocoapods gem. Changed podfile as described in the elegant solution. Short example of my podfile: platform :ios, '8.4' use_frameworks! def pods # visual pod 'ColorArt' # core pod 'JSONModel' end target…
Andre Cytryn
  • 2,506
  • 4
  • 28
  • 43
0
votes
1 answer

Jsonmodel - Model collection mapping not giving expected result

There are two JSONModels-Question and Option. Question model has following property. @property NSArray
Darth Pingu
  • 101
  • 2
0
votes
1 answer

How to create JSONModel class of key value is Object or Array

in my response some time is "url": {     “full_img”: "imagelink",     “id”: “1”,     “small_img”: "imagelink",    } and some time array "url": [       {        “full_img”: "imagelink", “id”: “1”,      “small_img”:…
0
votes
2 answers

Convert NSmangedObject to JsonModel

In my application I am using a JsonModel for parsing JSON response from server and while storing it in Core Data I am using NSManagedObject and NSManagedContext which is provided by Apple itself. Now whenever I fetch I want to convert the…
Dharni
  • 1
0
votes
1 answer

JsonModel NSString transform null to empty string

I am using JSONModel in my application. Is it possible to prepare category with JSONValueTransformer that will transform nil/null NSString to empty string (@""). So far when property in json response is null, my property in object becomes…
Piotr Gawłowski
  • 189
  • 1
  • 10
0
votes
1 answer

Questions about NSUinteger and int

I use JSONModel to capture data from json: @interface BBTCampusBus : JSONModel @property (strong, nonatomic) NSString * Name; @property (assign, nonatomic) NSUInteger Latitude; @property (assign, nonatomic) NSUInteger Longitude; @property…
Leo
  • 492
  • 1
  • 5
  • 15
0
votes
1 answer

Why can I import nothing in .m file

Edit: I finally found out that I import a header file which has indirect import for the JSONModel.h file. Today I tried AppCode and it gives me some hint that some import is useless. I found out that it seems that some subclasses of [JSONModel][1]…
xi.lin
  • 3,326
  • 2
  • 31
  • 57
0
votes
1 answer

iOS - Convert IFNULL(...) JSON key into object attribute

I'm working with Pocket API and getting a user's articles. I use the JSONModel library that I found on GitHub to make Article objects using the attributes that I get from the JSON response. Each Article object has a wordCount attribute that used to…
Rafi
  • 1,902
  • 3
  • 24
  • 46
0
votes
1 answer

JsonModelLib: Unable to parse if a variable does not exists in JSON

I know my question is a little confusing so please allow me to elaborate. JSON Parsing Lib : JSONModelLib MODEL #import "JsonModelLib/JSONModel.h" @interface CustomerDetailsModel : JSONModel @property (nonatomic, strong) NSString…
Vikas Bansal
  • 10,662
  • 14
  • 58
  • 100