Sorry, dumb question number 2 today. Is it possible to determine if a file is contained within the App Bundle? I can access files no problem, i.e.,
NSString *pathAndFileName = [[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"];
But can't figure out how to check if the file exists there in the first place.
Regards
Dave
[[NSFileManager defaultManager] fileExistsAtPath:pathAndFileName];
This code worked for me...
NSString *pathAndFileName = [[NSBundle mainBundle] pathForResource:fileName ofType:nil]; if ([[NSFileManager defaultManager] fileExistsAtPath:pathAndFileName]) { NSLog(@"File exists in BUNDLE"); } else { NSLog(@"File not found"); }
Hopefully, it will help somebody...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With