Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)testRequest
- {
- ...
- [[RKClient sharedClient] post: serviceURL params:requestParams delegate:self];
- [self someMethodToWaitForResult];
- STAssertTrue(receivedReply,@"...");
- ...
- }
- - (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response
- {
- receivedReply = true;
- }
- - (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error
- {
- receivedError = true;
- }
- -(void)someMethodToWaitForResult
- {
- while (!receivedReply || !receivedError)
- sleep(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement