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

Cancel request #1227

Closed
yamila-fraiman opened this issue May 5, 2016 · 3 comments
Closed

Cancel request #1227

yamila-fraiman opened this issue May 5, 2016 · 3 comments
Assignees
Labels

Comments

@yamila-fraiman
Copy link

Hi, I am cancelling a request but after .cancel() callback is called without errors and with a valid response. I call the cancel on the viewDidDisappear method because users can leave the screen while continue loading.

@cnoon
Copy link
Member

cnoon commented May 8, 2016

This can certainly happen. The NSURLSession APIs are all asynchronous in nature. Calling cancel does not ensure the request is actually cancelled before it is able to complete.

Cheers. 🍻

@cnoon cnoon closed this as completed May 8, 2016
@cnoon cnoon added the support label May 8, 2016
@cnoon cnoon self-assigned this May 8, 2016
@yamila-fraiman
Copy link
Author

But it should prevent calling the callback... Which is the workaround? I don't want to block the screen during the request. If users want to go back, they should be able to do that action.

@kumold
Copy link

kumold commented Jul 26, 2016

Same problem with response.response = nil and cannot differentiate is this nil from cancel or timeout. Request did not finish and cancel still calls callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants