KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am reading a txt file with a very simple code. The problem is that in the Log statments I only get the path of the file but contents are null. I guess that the problem lies in encoding part.Any Suggestions on how to read my text file. NSStringEncoding encoding; NSString* content; NSString* path = [[NSBundle mainBundle] pathForResource:@"colorpalette" ofType:@"txt"]; if(path) { content = [NSString stringWithContentsOfFile:path usedEncoding:&encoding error:NULL]; } NSLog(@"path is %@",path); if (content) { NSLog(@" content of file is %@",content); }
Tags (comma-separated)
Save Edits
Cancel