Appending to the end of a file with NSMutableString

I guess you could do a couple of things: NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:aPath]; [fileHandle seekToEndOfFile]; [fileHandle writeData:[textToWrite dataUsingEncoding:NSUTF8StringEncoding]]; [fileHandle closeFile]; Note that this will append NSData to your file — NOT an NSString. Note that if you use NSFileHandle, you must make sure that the file exists before hand. fileHandleForWritingAtPath will return nil if … Read more