Data.td where?


#1

Just for the curious. I posted a question earlier but since figured it out.

If you want to know the path of where data.td ends up, you can add this, so you’ll see the actual path in the console:

NSString *docPath()
{
    NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSLog(@"%@",[pathList objectAtIndex:0]);
    return [[pathList objectAtIndex:0] stringByAppendingPathComponent:@"data.td"];    
}

My output was:

2011-11-13 11:38:32.766 iTahDoodle[48223:f803] /Users/<your user name here>/Library/Application Support/iPhone Simulator/5.0/Applications/E3F4124F-91D3-4828-A200-A30D85A7C9F7/Documents

My take away from this is, that while you’re on the simulator this is where the file will be for this app. However, I expect it to be similar on the actual device.
I’m curious about once I get stuff running on a device if the console output will give me device specific paths, will console output even show up for an app running on a device? Well, guess that’s for learning from the iOS Programming book which I’ll be onto fairly soon I think.

Following this path down was kind of fun too.

Myrhillions-iMac:Documents myrh$ more data.td
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
        <string>Walk the dogs</string>
        <string>Feed the hogs</string>
        <string>Chop the logs</string>
        <string>Second</string>
        <string>Third</string>
        <string>Fourth</string>
        <string>Fifth</string>
        <string>Sixth</string>
        <string>Seventh offscreen I hope</string>
        <string>STephanie</string>
</array>
</plist>
Myrhillions-iMac:Documents myrh$ pwd
/Users/myrh/Library/Application Support/iPhone Simulator/5.0/Applications/E3F4124F-91D3-4828-A200-A30D85A7C9F7/Documents

Myrhillion


#2

I decided to locate the file with Spotlight from the command line: