views:

22

answers:

1

I've added a function so that my database resides on the device, however, in the simulator I can't find it on my mac at all. It used to be in Machintosh HD before I used my function.

+ (NSString*)getDBPath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *dbPath = [documentsDirectory stringByAppendingPathComponent:@"bc.db"];
return dbPath;
}
A: 

It will be stored at:

~/Library/Application Support/iPhone Simulator/<SDK>/Applications/<UUID>/Documents/bc.db

The <SDK> is a directory that represents the version of the simulator you are running. So, for instance, if you run it in the 4.1 simulator, replace <SDK> with 4.1.

The UUID is generated by the simulator and will be different for each time you install the app (i.e., hit the "Run" button in Xcode). To discover which app is the one you're working on, just enter the various directories and look at name of the application bundle.

Jason Coco