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 with data from several JSON sources

I have a fairly basic problem with the JSONModel. Let's say I have the following JSON: {"items": [ { "id": 1, "title": "Bla", "category": 1 } ]} and this one: {"categories": [ { "id": 1, …
webjunkie
  • 6,891
  • 7
  • 46
  • 43
0
votes
2 answers

How to create model classes using JSONModel?

I am trying to create Model Class by using JSONModel.My json Dictionary after using NSJSONSerialization looks like below. { apiStatus = { message = SUCCESS; success = 1; }; boardingPoints = ""; inventoryType = 0; seats = …
iCodes
  • 1,382
  • 3
  • 21
  • 47
0
votes
2 answers

Pass JSON data to another View

I have a TableView that load JSON content from web. I use AFNetworking and JSONModel. And I use this tutorial do Receive and Parse the Data Here is the code. - (UITableViewCell *)tableView:(UITableView *)tableView…
0
votes
1 answer

JSONModel Invalid JSON array data

I'm using JSONModel JSON parser (great library!), and I am getting a problem parsing this JSON response: http://api.setlist.fm/rest/0.1/search/setlists.json?cityName=vilalba The interesting JSON code in the response is the next one: { "setlists":{ …
Pablo Blanco
  • 69
  • 10
0
votes
1 answer

how do i allocate an NSMutableArray with a protocol?

This is a newbie question. I have an object that looks like the following (e.g. MyObject.h). #import #import "JSONModel.h" @protocol MyObject @end @interface MyObject : JSONModel @property (strong,nonatomic) NSString*…
Jane Wayne
  • 8,205
  • 17
  • 75
  • 120
0
votes
2 answers

ZF2 how to use View Helper for JsonModel Ajax Call

I use Zend Framework 2. I get data from server with AJAX and how can i return formatted data with JSON. (For example multi currency format as in the .phtml file $this->currencyFormat(1234.56, "TRY", "tr_TR")) I cannot use view helper from action.…
Yargicx
  • 1,704
  • 3
  • 16
  • 36
0
votes
1 answer

Nested Dictionary in JSONModel

I am getting an error when creating my JSONModels. Error Domain=JSONModelErrorDomain Code=1 "Invalid JSON data: Attempt to initialize JSONModel object using initWithDictionary:error: but the dictionary parameter was not an 'NSDictionary'."…
MCR
  • 1,633
  • 3
  • 21
  • 36
0
votes
0 answers

JSONModel `arrayOfModelsFromDictionaries` returning nil

I can't figure this out. I'm parsing the Glosbe dictionary API. Here's the API call (no need for a key): http://glosbe.com/gapi/translate?from=es&dest=eng&format=json&phrase=mujer&page=1&pretty=true And here's the Charles parsing of the response: I…
OdieO
  • 6,836
  • 7
  • 56
  • 88
0
votes
2 answers

JSONModel arrayOfModelsFromDictionaries -- error when key is SOMETIMES missing

So I'm just getting started with the youtube data API and JSONModel. Using their YouTubeBrowserDemo as my starting point: https://github.com/JSONModel/YouTubeBrowserDemo. So it's working fine except sometimes the MediaThumnail entry for certain…
OdieO
  • 6,836
  • 7
  • 56
  • 88
0
votes
1 answer

WebGL - looking for a way to save json model to vrml format

Basically I have a model(created dynamically using some inputs) on webgl in the form of array of vertices and an array of indices(indicating the surface to be drawn using the vertices from array of vertices). An array of colors of the vertices. I…
kck
  • 108
  • 1
  • 7
0
votes
3 answers

add value to JSON of title

I search a lot in stack and google try to find the answer which seems to be easy but I'm still stuck with it I write a code to encode json with values I wanted from . and I would like to add a key / value to the JSON the JSON is as following…
Twinkle
  • 430
  • 1
  • 5
  • 21
0
votes
1 answer

JSONModel used with Objects/Dictionaries

Ive been working with JSONModel, the tutorials are making sense. They are parsing JSON contain an array with multiple indexes. I wanted to make sure JSONModel allowed to be used with say this dataset:…
user39980
0
votes
1 answer

JSONModel - Using & Implementing KeyMapper

I am using JSONModel for a basic app that returns a JSON object. Here is a sample of the data I am returning: https://gist.github.com/ryancoughlin/8043604 - Focusing on the tide object. I am trying to work in JSONModel JSONKeyMapper - docs here…
user39980
0
votes
3 answers

JSONModel Invalid JSON data

I have this Json out of ASP MVC API I have the InvModel and the LotModel but when I call _InvFeed = [[InvModel alloc] initFromURLWithString:@"http://192.168.1.206/service/api/dto/inventory/1?p=Red%20Globe" …
Jose
  • 1,027
  • 1
  • 14
  • 23
0
votes
2 answers

JSONModel fetch JSON as string

Following this example of JSONModel #import "CountryModel.h" ... NSString* json = (fetch here JSON from Internet) ... NSError* err = nil; CountryModel* country = [[CountryModel alloc] initWithString:json error:&err]; I mimic it this way // Here…
Jose
  • 1,027
  • 1
  • 14
  • 23