In my iPhone app, how can I download a .txt file from the web, and then get it's contents into an NSString. For instance, say the text file was located at http://www.somewebsite.com/textfile.txt
Then what I want to do is:
if(user has internet connection)
NSString *textFile = download text file from http://www.somewebsite.com/textfile.txt
else
NSLog(@"user has no internet");
Can someone show me code to do this?