WebServices solution for iPhone - Second Stage
The FileDownloadController class Once I had the FileDownload class, it came to me the problem of using it many times and from many places. I could create as many FileDownload objects as needed, but this will create many variables and lines of code. My solution was to create a controller class ( FileDownloadController ), which I implement with a Singleton Pattern . The concept is: The FileDownloadController class will create and manage all needed FileDownload objects Whenever an object needs to download a file, it should get the FileDownloadController instance and then asks for the download Once the download is complete, or in case of error, a callback will be received by the requesting object In order to maintain certain acceptable performance, because the download process works in the background and consumes resources, there should be a limited number of concurrent downloads, this number is set when the controller is created. In my tests, using an iPhone 3G, an acceptable num...