PinkFloydRocks
PinkFloydRocks

Reputation: 808

Cancelling a URL request

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 URLRequests.

Any help is as always greatly appreciated!

Upvotes: 0

Views: 238

Answers (1)

Rob
Rob

Reputation: 4947

You can cancel any NSURLConnection by sending it a cancel command.

[connection cancel];

Upvotes: 1

Related Questions