Reading a text file using iOS
I am writing an iOS app where I wanted to read a .txt file and load it into a NSString.
After googling and reading tons of complicated solutions using NSFileManager I came up with a simple solution.
First, you need to add your .txt file into your project just by dragging it, your file will be added in your project Bundle Resources Items.
To get the file path use
[[NSBundle mainBundle] pathForResource:@"yourFile" ofType:@"txt"];
To load the content file into a NSString use
NSString stringWithContentsOfFile
Here is the code



