Is there any way (programmatically) that i can find the location of "Resource" folder. I want to create a new file in it at run time.
+3
A:
To get path to resource folder use:
NSString *path = [[NSBundle mainBundle] resourcePath];
However you won't be able to write anything there in run-time. New files should be saved to 1 of the following directories (depending of their usage):
Documents directory - persists between app launches and backuped by iTunes
NSString* docPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
Cashes directory - persists between app launches but not backuped by iTunes - you should place there files that can be easily restored by your program to improve device backup time
NSString* cachesPath = [NSSearchPathForDirectoriesInDomains (NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
Temporary directory - may not persist between app launches
NSString* tempPath = NSTemporaryDirectory();
Vladimir
2010-08-12 06:59:33
Thank you Vladimir.
Abhinav
2010-08-16 05:21:26