Where to find a plist file in my app?

Discussion in 'iOS Programming' started by mikezang, Jul 29, 2010.

  1. macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    I made app and use plist to save data, but I can"t find it. I defined it as below:
    Code:
    #define kFilename	@"trade.plist"
    
    and use it like this:
    Code:
    -(NSString *) dataFilePath {
    	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    	NSString *documentsDirectory = [paths objectAtIndex:0];
    	return [documentsDirectory stringByAppendingPathComponent:kFilename];
    }
    ...
    [array writeToFile:[self dataFilePath] atomically:YES];
    
    But it is very strange because I couldn't find that plist file, even in ~home/Library/Application Support/iPhone Simulator/, where can I find it?
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    If you mean find it in the Finder then why don't you log the path when you write the file?
     
  3. thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    Thanks for your suggestion.

    I got it, but the problem is that I just create that project, so that I thought that plist file should in the newest app folder, but I can't find, then I log path and I got it, it is not in the newest app folder, but in a older app folder!

    I am not sure about this, why the newest project's app folder is not the newest?
     
  4. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    I've seen that too. I have no explanation. I see multiple app folders get created for one app. Sometimes one is used and sometimes another one is used. Kind of annoying when user data disappears. Having the folders open in the Finder may affect this.
     

Share This Page