To get the path to the resource folder, use:
NSString *path = [[NSBundle mainBundle] resourcePath];
However, you cannot write anything at runtime. New files must be saved in 1 of the following directories (depending on their use):
Document Directory - Saved Between Launching Applications and iTunes Backup
NSString* docPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
Caches directory - saved between application launches, but not supported by iTunes - you must place files there that can be easily restored by your program to improve the backup time of the device.
NSString* cachesPath = [NSSearchPathForDirectoriesInDomains (NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
Temporary directory - may not be saved between application launches
NSString* tempPath = NSTemporaryDirectory();
source share