You will need to read the file in, modify the data / string that has been created from the file and then write the data / string out to replace the original file.
NSFileHandle
can add new data into a file but it can't delete arbitrary data from a file (it can only delete a specified number of bytes from the end of a file).