tags:

views:

101

answers:

1

Hi, I'm new to Xcode. I have the following code working perfectly to read a text file located in the project bundle.

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"txt"];
NSString *textFromFile = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];

My question is how to read the text file from URL?

A: 

It's a bit more involved than reading a file. Use the NURLConnection class.

Marcelo Cantos
Can you provide please a code example or a link please :)
Ali
I did provide a link. Clicking on the class name will take you to a fairly comprehensive guide.
Marcelo Cantos