What am I doing wrong here:
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
self.gpsFilePath = [documentsDirectory stringByAppendingString: @"/gpsReadings.txt"];
self.gpsFile = [NSFileHandle fileHandleForWritingAtPath:self.gpsFilePath];
[self.gpsFile writeData:@"GPS Readings"];
[self.gpsFile closeFile];
I need to create the file first:
[[NSFileManager defaultManager] createFileAtPath:self.gpsFilePath contents:nil attributes:nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With