Questions tagged [github-mantle]

Model framework for Cocoa and Cocoa Touch by GitHub

Mantle is a model framework for Cocoa and Cocoa Touch created and maintained by Justin Spahr-Summers at GitHub.

Mantle allows developers to quickly and easily write a simple model layer for their applications by providing them such tools, as:

  • Automatic two-way JSON serialization
  • Automatic two-way NSManagedObject serialization
  • Exception handling
  • Versioning support

Resources:

Questions tagged under should be directly connected with Mantle. If your project is using Mantle but the question is not connectet with it, don't add this tag to yor question.

91 questions
1
vote
1 answer

"Mantle" Parsing Dictionary with unknown keys

I'm using Mantle Framework for a will now, and its simple and easy. But I'm currently facing a issue when I get a dictionary of dictionary, I'm not managing to parse them correctly. For example : { LSE = { name = LSE; …
MCMatan
  • 8,623
  • 6
  • 46
  • 85
1
vote
1 answer

Merge two objects of same type

I have two objects: deviceConfigInfo and deviceStatusInfo Both contain an array of devices (so theres a third device object actually). For each device returned in deviceConfigInfo there are these…
Hodson
  • 3,438
  • 1
  • 23
  • 51
1
vote
3 answers

NSDate issue with NSJSONSerialization when using Mantle library

I have an issue serialising core data managed object into JSON object. I am using Mantle to do this and this is related NSDate. I am getting this error. 'Invalid type in JSON write (__NSDate)' This is where this exception is throwing. It is fine…
1
vote
1 answer

Using Mantle with Sickbeard API

I'm trying to map the responses from the Sickbeard API to my objects with Mantle, but I can't figure out how, since the response is key-value based using TVDB id's as key, like this: "data": { "71663": { "air_by_date": 0, …
Sander
  • 1,183
  • 12
  • 27
1
vote
1 answer

How to hook into Mantle

I'm using Mantle and it fits my basic need. After declaring JSONKeyPathsByPropertyKey and some PropertyJSONTransformer, I can turn a JSON Dictionary to an object ETPUser *user = [MTLJSONAdapter modelOfClass:[ETPUser class]…
onmyway133
  • 45,645
  • 31
  • 257
  • 263
0
votes
1 answer

How debug the issue of Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee1ba8578)

I encounter the Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee1ba8578) error. As I know this cause from abnormal object release. But seem as stuck [MTLModel description] infinite loop. Even already add one exception breakpoint in project and…
Joshpy
  • 560
  • 8
  • 21
0
votes
0 answers

Dictionary keys sorted as they came in http response with Mantle

You parse a property as a NSDictionary object in a MTLModel object, and then, you get the keys with allkeys method. @interface SomeModel : MTLModel @property (copy, nonatomic, readonly) NSDictionary…
Fran J Martínez
  • 236
  • 2
  • 12
0
votes
1 answer

new property to model in xcode results in NSLocalizedDescription - Could not serialize managed object

@interface ModelClass : SCObject @property (strong, nonatomic) NSString *scObjectID; @property (strong, nonatomic) NSString *title; @property (strong, nonatomic) NSString *videoUrlHLS; @property (strong, nonatomic) NSString…
0
votes
2 answers

Mantle Objective C: mapping nested properties to JSON

I want to use Mantle to serialize some objects to this JSON: { "name": "John Smith", "age": 30, "department_id":123 } I have two classes Department Employee: #import @interface Department : MTLModel
Mina Wissa
  • 10,923
  • 13
  • 90
  • 158
0
votes
1 answer

How to Incorporate an Array Into Model Object With Mantle?

I have a JSON object like so: { "name": "Brendan", "images": ["some.url.to.image1", "some.url.to.image2", "some.url.to.image3"] } My class is as follows: @interface MyModel : MTLModel @property…
Stunner
  • 12,025
  • 12
  • 86
  • 145
0
votes
1 answer

Mantle + Core Data: this class is not key value coding-compliant for the key

I'm trying to use Mantle and Core Data to build a client for reddit but I keep getting *** Caught exception setting key "upvotes" : [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key upvotes.…
Liau Jian Jie
  • 7,071
  • 2
  • 15
  • 16
0
votes
1 answer

How to use sub dictionary in Mantle with Overcoat?

I decided to use Mantle to consume some JSON endpoints, but the structure of the JSON is different depending on whether you're GETing or POSTing an object. Take the users endpoint for instance: When requesting a user you get a response similar to…
Erik B
  • 40,889
  • 25
  • 119
  • 135
0
votes
0 answers

NSSet property returning count of 1 when added to CoreData via Mantle

so I have an object with several properties that I want to add to coredata however I'm using the Mantle framework that I am not too familiar with. My Object(.h): #import #import "RTModel.h" @import CoreLocation; @class…
0
votes
1 answer

Json Array to Obj Property conversion using Mantle on iOS

I'm currently trying to simplify my Obj-C Model but it seems the json data makes it a bit more complex than I thought. I can't get the array data to convert to some booleans. As far as I know it's impossible to use the Frameworks…
Michael Z
  • 25
  • 4
0
votes
1 answer

Remove duplicates from NSMutableArray of NSDictionary depending on value of key

I have a NSMutableArray of, say, 10 NSMutableArrays. Each of these NSMutableArrays contains different number of NSDictionary objects for which I have made a model class. I get this data from an API response. First time you make an API call, the…
Skywalker
  • 1,590
  • 1
  • 18
  • 36