i can write to a text file on iphone..but each time i write my previous value is erased, is there any way to keep writing data separated by \\n??
this is my code
Use NSFileHandle method seekToEndOfFile and the call to writeData
NSFileHandle *aFileHandle;
NSString *aFile;
aFile = [NSString stringWithString:@"Your File Path"]; //setting the file to write to
aFileHandle = [NSFileHandle fileHandleForWritingAtPath:aFile]; //telling aFilehandle what file write to
[aFileHandle truncateFileAtOffset:[aFileHandle seekToEndOfFile]]; //setting aFileHandle to write at the end of the file
[aFileHandle writeData:[toBeWritten dataUsingEncoding:nil]]; //actually write the data