UIDocumentBrowserViewController can't create documents under "On My iPhone"

For some reason, my app cannot create documents in the "On My iPhone" section in its file browser.

I'm using

UIDocumentBrowserViewController
.
UISupportsDocumentBrowser
is true in my
Info.plist
.

I see folders for various other apps under "On My iPhone" but there isn't one present for mine.

I can create documents in iCloud drive.

Is there a setting that enables document creation "On My iPhone." Why would this ever be disabled? (ARGH!)

Replies

Have you saved a document in any app with the iPhone you are using? I have found that documents will not save on the device until you save a document on that device using any app. It is easiest to save a document in one of Apple's iWork apps.


I had a similar problem the first time I tried to save a document on my iOS device on an app I was developing. What I had to do to fix the issue was to save a document in Pages and copy the document from iCloud to the device. Once I had a document on the device in Pages, I was able to save documents on the device in my app.

According to Developer Tech Support, the local documents folder only shows up if there is a document in it. It's easy to test: when you delete all the local docs, the folder disappears. Interestingly, the user can also move a doc to the local folder, causing it to show up again.


Anyone know why it works this way? Super confusing.