You've mentioned the writeToFile:atomically:
method but you haven't told us what class this method is being called on. For example, NSString
, NSArray
, NSDictionary
and other classes have a method with this name and they all behave differently as might expect given teh different types of data structures.
From the above file output, it looks like you're probably calling this on an NSArray
which is why it gets written in Plist format. I assure you that strings get written plainly if you using an NSString
, eg:
NSString *s = @"A string";
[s writeToFile:path atomically:YES];
will produce a file with:
A String
You may want to convert various other data structures into a string before you write it to a file.