You cannot change the contents of the compiled application folder. This is because the package is a compiled application. This prevents the possibility of malware modifying applications after installation.
Files created at runtime must be saved in the Documents
, Temp
or Cache
folders. These folders are available only for your application. No other application can access the contents of these folders.
Code example:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error; [[NSFileManager defaultManager] createDirectoryAtPath:[documentsDirectory stringByAppendingPathComponent:@"yourFolderName"] withIntermediateDirectories:NO attributes:nil error:&error];
source share