The code you're posting is doing a synchronous download, which is the worst way to do a download from the internet. It will cause your app to freeze until the download is complete, and you have no way to do anything at all while the download is taking place.
You should use NSURLRequest and NSURLConnection to create an async download. NSURLConnection hands you data as it comes in, so if you know the total file size, it's a snap to calculate the % complete.
To use NSURLConnection you have to set yourself up as the delegate, and then handle 2 or 3 delegate messages. It's not that hard.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
The code you're posting is doing a synchronous download, which is the worst way to do a download from the internet. It will cause your app to freeze until the download is complete, and you have no way to do anything at all while the download is taking place.
You should use NSURLRequest and NSURLConnection to create an async download. NSURLConnection hands you data as it comes in, so if you know the total file size, it's a snap to calculate the % complete.
To use NSURLConnection you have to set yourself up as the delegate, and then handle 2 or 3 delegate messages. It's not that hard.