Reputation: 808
I was wondering if there was a way to cancel a URLRequest
?
Use intended is for example if a user taps a button that uses a URLRequest
to get data from my server, but then changes his mind and taps another button that does a new request with different data returned from the server.
I'm looking for something like self cancelPreviousSelector
but for URLRequest
s.
Any help is as always greatly appreciated!
Upvotes: 0
Views: 238
Reputation: 4947
You can cancel any NSURLConnection by sending it a cancel command.
[connection cancel];
Upvotes: 1