Note that there are some explanatory texts on larger screens.

plurals
  1. PONSManagedObject Parsing with RestKit Mapping
    text
    copied!<p>Here below is the code I am using for class:</p> <pre><code>@interface DBUser : NSManagedObject @property (nonatomic, retain) NSString * username; @property (nonatomic, retain) NSString * email; @property (nonatomic, retain) NSString * accessToken; @property (nonatomic, retain) NSNumber * userID; @end @implementation DBUser @dynamic username; @dynamic email; @dynamic userID; @dynamic accessToken; @end </code></pre> <p>here is my mapping:</p> <pre><code>RKManagedObjectMapping* userMapping = [RKObjectMapping mappingForClass:[DBUser class]]; userMapping.setDefaultValueForMissingAttributes = NO; [userMapping mapKeyPathsToAttributes: @"id", @"userID", @"email", @"email", @"username", @"username", @"access_token", @"accessToken", nil]; [objectManager.mappingProvider registerMapping:userMapping withRootKeyPath:@"user"]; </code></pre> <p>And route:</p> <pre><code>[objectManager.mappingProvider registerMapping:userMapping withRootKeyPath:@"user"]; </code></pre> <p>Here is the json object that returns from service:</p> <pre><code>{ "user": { "id": 1, "username": "username", "email": "email@email.com", "access_token": "59f99efcffa9af7252d5ce1839082bd7e740e289e2577dda592c68647dc4e0db" } } </code></pre> <p>But in <code>objectDidLoad</code> method I am having some data failure:</p> <pre><code>&lt;DBUser: 0x5939cc0&gt; (entity: DBUser; id: 0x4f432e0 &lt;x-coredata://6F302428-0538-41D0-9627-81C80E905DA8/DBUser/p11&gt; ; data: &lt;fault&gt;) </code></pre> <p>Here I am attaching the complete log for the trace. It detects the object map it well but when i get <code>self</code> it do not show any data.</p> <p><a href="http://goo.gl/OcouL" rel="nofollow">http://goo.gl/OcouL</a></p> <p>What is wrong with this code or what I am missing in it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload