Is there some blindingly obvious reason why this is producing a nil string instead of the actual text content of the file?
NSString *fromFile = [NSString stringWithContentsOfFile:
@"file://localhost/Users/username/Desktop/test.txt"];
NSLog(@"%@", fromFile);
PRINTS: "(null)"
The file is a plain ASCII text file saved from TextWrangler with contents ' abc '.
The path comes from dragging the actual file from the desktop into the Xcode editor window.
I've also tried without "file://localhost".
The method documentation says "Returns nil if the file can't be opened". There's nothing unusual about the file (not locked, etc.). It has default Unix permissions and was created by the same user as is running Xcode.
I know this method is deprecated -- trying to get this working first.