Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BFTask: returning nil #195

Closed
smarkars opened this issue Nov 2, 2015 · 2 comments
Closed

BFTask: returning nil #195

smarkars opened this issue Nov 2, 2015 · 2 comments

Comments

@smarkars
Copy link

smarkars commented Nov 2, 2015

I'm trying to understand how to use BFTask.

Here is the code from an SDK. Once the request gets cancelled the completion handler block is called and nil is returned from the current continue block of the task. My question is even if nil is returned from the continue block it will continue to the next continue block also. Right?

Also returning nil from a continue block does implicitly returns a completed BFTask?

- (void)taskWithDelegate:(AWSURLSessionManagerDelegate *)delegate 
...
continueWithSuccessBlock:^id(BFTask *task) {
        AWSNetworkingRequest *request = delegate.request;
        if (request.isCancelled) {
            if (delegate.dataTaskCompletionHandler) {
                AWSNetworkingCompletionHandlerBlock completionHandler = delegate.dataTaskCompletionHandler;
                completionHandler(nil, [NSError errorWithDomain:AWSNetworkingErrorDomain
                                                           code:AWSNetworkingErrorCancelled
                                                       userInfo:nil]);
            }
            return nil;
        }

...
@hhanesand
Copy link

You're correct on both assumptions. First and second

@smarkars
Copy link
Author

smarkars commented Jan 6, 2016

Thanks

@smarkars smarkars closed this as completed Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants