-1
我有幾個NSString
對象要添加到文件中。我怎樣才能做到這一點。將字符串寫入目標C中的文件
到目前爲止,我探討的選項是
NSFilemanager - createFileAtPath:path contents:(NSData*)content
但我不知道怎麼我的字符串轉換爲NSData的,所以我可以把它們寫在文件中。
另一種選擇是NSFileHandle fileHandleForWritingAtPath
但我不完全清楚它的語法和語義。
的http://計算器。 com/questions/10352665/write-nsstring-to-file – 2013-06-27 13:51:02
http://stackoverflow.com/questions/3406516/failure-to-write-nsstring-to-file-on-ipad – 2013-06-27 13:51:31