Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Soulstorm

macrumors 68000
Original poster
Feb 1, 2005
1,887
1
I want to make an application that works like this:

On entering a view in the program the application will begin downloading some data from the internet. This happens in the background. However, since the data to be downloaded may require some waiting, I want to provide the user the ability to leave this section of the application.

So, what I need is a way to stop the downloading of data from the network after the download has began. Is there any class I can use for that? Right now I am using the NSURL class with "initWithContentsOfURL" method to obtain the data from the internet.

Any ideas?
 
Use NSURLConnection's async loading method. It has a cancel method that you can use if the connection isn't complete and you want to stop the download.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.