I'm using NSFileManager to create a file at a specified path with text view contents. I'm using following code
[[NSFileManager defaultManager] createFileAtPath:saveFileName contents:[[tView text] dataUsingEncoding:NSASCIIStringEncoding] attributes:nil];
But the problem is that, its creating file with no contents. I'm sure that text contents are not nil. How can I check and confirm that data is written into file.
Some suggestions:
[tView text]
to make sure it is not empty.NSUTF8StringEncoding
or NSUTF16StringEncoding
.Localization may be a problem with plain ASCII encoding because ASCII does not handle multibyte character encodings.