ios - RestKit:postObject 调用了什么委托(delegate)方法?
<p><p>调用<code>-(RKObjectLoader *)postObject:(id<NSObject>)object delegate:(id<RKObjectLoaderDelegate>)delegate</code>方法后调用RKObjectLoaderDelegate的什么方法?</p>
<p>一旦我的 POST 成功,我会尝试运行更多代码。</p>
<p><strong>编辑(更多信息):</strong></p>
<p>@Paul 提到的两种方法都没有被调用,但我的服务器对 POST 的解释有些正确,因为正在写入数据库。</p>
<p>在应用初始化期间,我正在执行以下操作:</p>
<pre><code>// Grab the reference to the router from the manager
RKObjectRouter *router = .router;
// Define a default resource path for all unspecified HTTP verbs
toResourcePath:@"/events_messages/:idPrimaryKey"];
toResourcePath:@"/event_messages" forMethod:RKRequestMethodPOST];
</code></pre>
<p>当我准备发布时,我正在这样做:</p>
<pre><code>RKObjectMapping *objectMapping = ];
;
;
;
[.mappingProvider registerMapping:objectMapping withRootKeyPath:@"event_message"];
[ postObject:eventMessage delegate:self];
</code></pre>
<p>这是我在控制台中遇到的错误:</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></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code> - (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects;
</code></pre>
<p>或</p>
<pre><code> - (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error;
</code></pre></p>
<p style="font-size: 20px;">关于ios - RestKit:postObject 调用了什么委托(delegate)方法?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/10307649/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/10307649/
</a>
</p>
页:
[1]