saving some data I collected using plist: info.plist
My questions is after saving all data, I want to retrieve it and see it (I have done it before using Organizer), but now the document does not even exist under app in organizer.
The filepath is outputted via debugger shows that the document path is created, but how can I find it???
Here is my result of debugger:
I try to find that path in organizer under app, but just can not. Maybe sth has to do with bundle identifier, not sure though.
and here is my code for saving data:
If you guys have any suggestions or ideas, that would be appreciated and grateful.
Thank you
My questions is after saving all data, I want to retrieve it and see it (I have done it before using Organizer), but now the document does not even exist under app in organizer.
The filepath is outputted via debugger shows that the document path is created, but how can I find it???
Here is my result of debugger:
Code:
[B]run[/B]
Running
[Switching to thread 10755]
[Switching to thread 10755]
(gdb) [B]continue[/B]
warning: UUID mismatch detected with the loaded library - on disk is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libgcc_s.1.dylib
=uuid-mismatch-with-loaded-file,file="/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libgcc_s.1.dylib"
[B]2010-05-25 16:55:54.964 AccelerometerGraph[1426:207] /var/mobile/Applications/16AA4CC1-D3E6-4017-8728-E8263CF6967C/Documents/walk2.txt
2010-05-25 16:55:55.116 AccelerometerGraph[1426:207] Done Saving[/B]
I try to find that path in organizer under app, but just can not. Maybe sth has to do with bundle identifier, not sure though.
and here is my code for saving data:
Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filepath = [documentsDirectory stringByAppendingPathComponent:@"data.txt"];
NSLog(filepath);
// create a blank file, overwrite, if exists
[[NSFileManager defaultManager] createFileAtPath:filepath contents:[NSData data] attributes:nil];
/*
// get a handle to the file
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filepath];
line = [NSString stringWithFormat:@" X Axis Y Axis Z Axis\n", nil];
// NSLog(@"Display x, y, z is: %f, %f, %f", records[i][0], records[i][1], records[i][2]);
lineAsData = [line dataUsingEncoding:NSUTF8StringEncoding];
[fileHandle writeData:lineAsData];
[fileHandle closeFile];
If you guys have any suggestions or ideas, that would be appreciated and grateful.
Thank you