createDirectory() causing crash in iOS simulator

Hi there,

I’m getting a “Permission denied” error when trying to createDirectory() on iOS simulator only (code works fine on mac, haven’t tried on real iOS devices yet). I have enabled support for “Document Browser” in Projucer.

(Possibly unrelated, but I’m also getting a the alert “App would like access to your microphone” everytime I run the simulator even though I have “Microphone Access” disabled in Projucer.)

The crash site appears to be here:

The resulting error “Permission denied”:

Here’s the call site, (the file path appears to be fine?):
58%20am

Thanks for the help,
Ian.

This is only a guess, but to my knowledge, iOS does not give the user control about the file system. Therefore, apps can’t create directories as they wish - you’ll probably have to work with a folder the system gives you to store data in.

2 Likes

Ahh good guess. Creating directory in File::getCurrentWorkingDirectory() was the problem. Changing this to File::getSpecialLocation(File::SpecialLocationType::userDocumentsDirectory) has appeared to fix it. I knew about the sandboxing directory structure but assumed permissions would be granted to currentWorkingDirectory which on second thought is a bad assumption seeing as this by definition should be outside the sandbox. Thanks for your help.

2 Likes