I want to be able to create, rename or remove the temporary file inside the resourcePath
from the mainBundle
.
NSString* path = [[NSBundle mainBundle] resourcePath];
NSFileManager* filemgr = [NSFileManager defaultManager];
for (int i=0; i<size; i++)
{
NSString* file = [NSString stringWithFormat:@"%@/_%i.jpg", path, i];
if ([filemgr fileExistsAtPath:file] == YES)
{
[filemgr removeItemAtPath:file error: NULL];
}
[file release];
}
[filemgr release];
Do I need extra permission to run this on a real device?