Question

After upgrading to iOS8 beta 4, when I want to preset UIDocumentPickerViewController to select document picker such as iCloud, it always shows "No locations available" and asks me to enable Document & Data of iCloud Drive.

Import and open still work normally. I can see all document pickers include iCloud and my own picker in the menu. I am pretty sure I've enabled iCloud Drive and allow all apps using Document & Data in General > iCloud setting.

Strangely, this issue will not happened on simulator, but only on device. Before beta4, I never saw this on both simulator and device.

I've checked code sign of iCloud on both host app and my document picker/storage provider app, but it helps nothing. It does not throw any error or warning message. I have no futher clue about this case.

I use the NewBox as the host app, which is provide by Apple WWDC2014: https://developer.apple.com/wwdc/resources/sample-code/

I also posted this issue at Apple dev forum few days ago, but got no reply. Anyone who also has the same issue? Thanks a lot.

Snapshot: http://i.imgur.com/s0rxPEV.png

Was it helpful?

Solution

Yes, I notice the same behavior as well, and found a fix.

For the NewBox app, the problem seems to be related to sharing permissions with the particular file in question, namely TestUIDocument_0.txt within the app bundle.

Jul 31 09:54:36 iPad kernel[0] <Notice>: Sandbox: NewBox(158) deny file-issue-extension /private/var/mobile/Containers/Bundle/Application/<GUID>/NewBox.app/TestUIDocument_0.txt
Jul 31 09:54:36 iPad kernel[0] <Notice>: Sandbox: com.apple.UIKit.(161) deny file-read-metadata /private/var/mobile/Containers/Bundle/Application/<GUID>/NewBox.app/TestUIDocument_0.txt

I fixed the problem by copying the file over to within the documents directory, and setting self.documentURL to that location.

Don't know if this is a feature or a bug -- for the move option, I can see that files within the app bundle cannot be moved, so makes sense to disallow move from the app bundle.

But export, from what I understand, is just a copy operation, so don't know why this is disallowed from within the app bundle, but is from the documents directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top