How to read a file in iPhone?

iphone, nsfilemanager, objective-c

Solution

Use NSString's stringWithContentsOfFile: method.

NSString *fileContents = [NSString stringWithContentsOfFile:@"some/file.txt"];

Problem

I am trying to read a .txt file from my documents directory in the form of NSString. Any idea how to read the file into NSString? Thank you...

Original source