I am working on app, in which the first screen’s ViewDidAppear has a check that if my plist at
NSString *path = [@"~Documents" stringByExpandingTildeInPath];
NSString *filePath = [NSString stringWithFormat:@"%@/data.plist",path];
exists then go to second view otherwise stay on first view at loadtime. The issue is that when i run my app in the simulator this check of if plist exists work but it doesn’t work when i install my app on iphone device and then run it over there. I am stuck in this issue. Solutions are appreciated in advance
You get the path to Documents directory in your application sandbox incorrectly, correct way will be:
Also, how do you put it to that folder? If that plist file is resource in your application then it is situated in application bundle initially and you need to copy it to documents folder before using it (if you want write access to it) or just read it from resources.