Note that there are some explanatory texts on larger screens.

plurals
  1. PORestKit: What delegate method is called for postObject?
    primarykey
    data
    text
    <p>What method of RKObjectLoaderDelegate gets called after the method <code>- (RKObjectLoader *)postObject:(id&lt;NSObject&gt;)object delegate:(id&lt;RKObjectLoaderDelegate&gt;)delegate</code> is called?</p> <p>I'm trying to run some more code once my POST is successful.</p> <p><strong>EDIT (more info):</strong></p> <p>Neither of the methods that @Paul mentions are being called, but my server is interpreting the POST somewhat correctly because the DB is being written to.</p> <p>During app initialization, I am doing the following:</p> <pre><code>// Grab the reference to the router from the manager RKObjectRouter *router = [RKObjectManager sharedManager].router; // Define a default resource path for all unspecified HTTP verbs [router routeClass:[EventMessage class] toResourcePath:@"/events_messages/:idPrimaryKey"]; [router routeClass:[EventMessage class] toResourcePath:@"/event_messages" forMethod:RKRequestMethodPOST]; </code></pre> <p>And when I am ready to POST, I am doing this:</p> <pre><code>RKObjectMapping *objectMapping = [RKObjectMapping mappingForClass:[EventMessage class]]; [objectMapping mapKeyPath:@"user_id" toAttribute:@"userId"]; [objectMapping mapKeyPath:@"event_id" toAttribute:@"eventId"]; [objectMapping mapKeyPath:@"message" toAttribute:@"message"]; [[RKObjectManager sharedManager].mappingProvider registerMapping:objectMapping withRootKeyPath:@"event_message"]; [[RKObjectManager sharedManager] postObject:eventMessage delegate:self]; </code></pre> <p>And this is the error that I get in the console:</p> <blockquote> <p>Error Domain=JKErrorDomain Code=-1 "Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'." UserInfo=0x7b9f510 {JKAtIndexKey=0, JKLineNumberKey=1, NSLocalizedDescription=Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'.}</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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