In my iPhone application, how can I download a .txt file from the Internet and then get its contents in NSString. For example, let's say the text file was at http://www.somewebsite.com/textfile.txt
Then I want to do the following:
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 the code for this?
source share