RKRequests
如果它们失败,我正在尝试让我的应用程序重试。我正在尝试这样做:
- (void)objectLoader:(RKObjectLoader *)objectLoader didFailWithError:(NSError *)errorIn
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.waitView stop];
NSInteger code = objectLoader.response.statusCode;
if (201 != code && 200 != code)
{
// determine whether to requeue the request or not
if ([objectLoader.userData isEqualToString:@"capture"]) // requeue captures
{
NSLog(@"requeueing request");
[objectLoader.queue cancelRequest:objectLoader];
[objectLoader send];
}
}
}
...但它总是崩溃,因为它objectLoader
似乎是cancelRequest
行后的一个悬空指针。如果RKRequest
失败,我如何重试而不崩溃?