The 'system' C function not working in iOS 9 beta 2

Hi, I have the following in my application:


NSString *cmd=[NSString stringWithFormat:@"rm -rf %@\n", cachePath];

system([cmd UTF8String]);


With iOS 9 beta 1 & 2, the app crashes when it hits the 'system' function with a SIGABRT. Any ideas?

could this be caused by the system function expecting a char[] array and not an NSString?


char *cmd[200];
cmd = snprintf("rm -rf %s", sizeof(cachePath), cachePath);
system(cmd);

Possibly, but this has been working since the early versions of iOS. It's only in iOS 9 that it has crashed.

This could also be due to system changes. Is there a reason you aren't using NSFileManager to accomplish the same task?

The 'system' C function not working in iOS 9 beta 2
 
 
Q