Fix for RKSpecResponseLoader returning control to the test case before the object loader delegate methods have been invoked. Fixes #49

This commit is contained in:
Blake Watters
2011-04-14 13:11:18 -04:00
parent 9593612aab
commit 2395f5dc76
2 changed files with 13 additions and 4 deletions

View File

@@ -63,12 +63,21 @@
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response {
NSLog(@"Loaded response: %@", response);
_response = [response retain];
_awaitingResponse = NO;
_success = YES;
// If request is an Object Loader, then objectLoader:didLoadObjects:
// will be sent after didLoadResponse:
if (NO == [request isKindOfClass:[RKObjectLoader class]]) {
_awaitingResponse = NO;
_success = YES;
}
}
- (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error {
[self loadError:error];
// If request is an Object Loader, then objectLoader:didFailWithError:
// will be sent after didFailLoadWithError:
if (NO == [request isKindOfClass:[RKObjectLoader class]]) {
[self loadError:error];
}
}
- (void)requestDidCancelLoad:(RKRequest *)request {

View File

@@ -1 +1 @@
--workspace RestKit.xcodeproj/project.xcworkspace
--workspace RestKit.xcodeproj/project.xcworkspace --scheme UISpec --sdk 4.3