Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用startAccessingSecurityScopedResource仍然可以获得;不能’;无法打开,因为您没有’;“我没有查看它的权限”;_Ios_Objective C_Nsfilecoordinator - Fatal编程技术网

Ios 使用startAccessingSecurityScopedResource仍然可以获得;不能’;无法打开,因为您没有’;“我没有查看它的权限”;

Ios 使用startAccessingSecurityScopedResource仍然可以获得;不能’;无法打开,因为您没有’;“我没有查看它的权限”;,ios,objective-c,nsfilecoordinator,Ios,Objective C,Nsfilecoordinator,使用本机应用程序“文件”拾取文件时,请调用我的应用程序并获取路径: file:///private/var/mobile/Containers/Shared/AppGroup/F9BF9D9E-4756-40ED-85A4-810B4D1A67CB/File%20Provider%20Storage/myFile.abcd 我在字符串“originalPath”中捕捉路径 error.localizerDescription的值 The file “myFile.abcd” couldn’t

使用本机应用程序“文件”拾取文件时,请调用我的应用程序并获取路径:

file:///private/var/mobile/Containers/Shared/AppGroup/F9BF9D9E-4756-40ED-85A4-810B4D1A67CB/File%20Provider%20Storage/myFile.abcd
我在字符串“originalPath”中捕捉路径

error.localizerDescription的值

The file “myFile.abcd” couldn’t be opened because you don’t have permission to view it.
在控制台中,我可以看到:

filecoordinationd   Claim 97D67388-49D7-4076-9622-0FD18C9DE063 granted in server    14:15:47.421475-0700
filecoordinationd   Claimer for 97D67388-49D7-4076-9622-0FD18C9DE063 is waiting for provider com.apple.FileProvider.LocalStorage to provide 14:15:47.421495-0700
filecoordinationd   Hit the server for a process handle 9fc643c000014c6 that resolved to: [application<com.mydomain.myappname>:5318]    14:15:47.421516-0700
filecoordinationd   Caching handle <private>, with ipc id 9fc643c000014c6, and pid 5318 14:15:47.421535-0700
fileproviderd   com.apple.FileProvider.LocalStorage providing <private> for claim 97D67388-49D7-4076-9622-0FD18C9DE063  14:15:47.421832-0700
fileproviderd   com.apple.FileProvider.LocalStorage began providing 14:15:47.421853-0700
filecoordinationd   Claim 97D67388-49D7-4076-9622-0FD18C9DE063 granted in server    14:15:47.421475-0700
filecoordinationd   Claimer for 97D67388-49D7-4076-9622-0FD18C9DE063 is waiting for provider com.apple.FileProvider.LocalStorage to provide 14:15:47.421495-0700
filecoordinationd   Hit the server for a process handle 9fc643c000014c6 that resolved to: [application<com.mydomain.myappname>:5318]    14:15:47.421516-0700
filecoordinationd   Caching handle <private>, with ipc id 9fc643c000014c6, and pid 5318 14:15:47.421535-0700
fileproviderd   com.apple.FileProvider.LocalStorage providing <private> for claim 97D67388-49D7-4076-9622-0FD18C9DE063  14:15:47.421832-0700
fileproviderd   com.apple.FileProvider.LocalStorage began providing 14:15:47.421853-0700
filecoordinationd   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 invoked in server    14:15:47.421862-0700
myAppName   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 granted in client    14:15:47.421880-0700
myAppName   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 invoked in client    14:15:47.421923-0700
文件协调和索赔97D67388-49D7-4076-9622-0FD18C9DE063在服务器14:15:47.421475-0700中授予
97D67388-49D7-4076-9622-0FD18C9DE063的文件协调请求器正在等待提供程序com.apple.FileProvider.LocalStorage提供14:15:47.421495-0700
FileCoordination D点击服务器获取解析为:[应用程序:5318]14:15:47.421516-0700的进程句柄9fc643c000014c6
文件协调D缓存句柄,ipc id为9fc643c000014c6,pid 5318 14:15:47.421535-0700
fileproviderd com.apple.FileProvider.LocalStorage提供索赔97D67388-49D7-4076-9622-0FD18C9DE063 14:15:47.421832-0700
fileproviderd com.apple.FileProvider.LocalStorage开始提供14:15:47.421853-0700
文件协调和索赔97D67388-49D7-4076-9622-0FD18C9DE063在服务器14:15:47.421475-0700中授予
97D67388-49D7-4076-9622-0FD18C9DE063的文件协调请求器正在等待提供程序com.apple.FileProvider.LocalStorage提供14:15:47.421495-0700
FileCoordination D点击服务器获取解析为:[应用程序:5318]14:15:47.421516-0700的进程句柄9fc643c000014c6
文件协调D缓存句柄,ipc id为9fc643c000014c6,pid 5318 14:15:47.421535-0700
fileproviderd com.apple.FileProvider.LocalStorage提供索赔97D67388-49D7-4076-9622-0FD18C9DE063 14:15:47.421832-0700
fileproviderd com.apple.FileProvider.LocalStorage开始提供14:15:47.421853-0700
文件协调声明D578716E-D91A-4ECB-9348-CF9824341DA9在服务器14:15:47.421862-0700中调用
myAppName索赔D578716E-D91A-4ECB-9348-CF9824341DA9在客户14:15:47.421880-0700中授予
myAppName索赔D578716E-D91A-4ECB-9348-CF9824341DA9在客户端中调用14:15:47.421923-0700
On call startAccessingSecurityScopedResource始终为FALSE,在fileCoordinator中的访问器中永远看不到原始URL


是否有其他读取文件的方法,我可以请求权限吗?

您在哪里创建安全范围的书签?当我从我的应用程序中,特别是在下载文件夹中触摸扩展名为.abcd(我的自定义文件)的文件时,我会收到安全范围的路径。从电子邮件中打开文件时,此代码工作正常。
filecoordinationd   Claim 97D67388-49D7-4076-9622-0FD18C9DE063 granted in server    14:15:47.421475-0700
filecoordinationd   Claimer for 97D67388-49D7-4076-9622-0FD18C9DE063 is waiting for provider com.apple.FileProvider.LocalStorage to provide 14:15:47.421495-0700
filecoordinationd   Hit the server for a process handle 9fc643c000014c6 that resolved to: [application<com.mydomain.myappname>:5318]    14:15:47.421516-0700
filecoordinationd   Caching handle <private>, with ipc id 9fc643c000014c6, and pid 5318 14:15:47.421535-0700
fileproviderd   com.apple.FileProvider.LocalStorage providing <private> for claim 97D67388-49D7-4076-9622-0FD18C9DE063  14:15:47.421832-0700
fileproviderd   com.apple.FileProvider.LocalStorage began providing 14:15:47.421853-0700
filecoordinationd   Claim 97D67388-49D7-4076-9622-0FD18C9DE063 granted in server    14:15:47.421475-0700
filecoordinationd   Claimer for 97D67388-49D7-4076-9622-0FD18C9DE063 is waiting for provider com.apple.FileProvider.LocalStorage to provide 14:15:47.421495-0700
filecoordinationd   Hit the server for a process handle 9fc643c000014c6 that resolved to: [application<com.mydomain.myappname>:5318]    14:15:47.421516-0700
filecoordinationd   Caching handle <private>, with ipc id 9fc643c000014c6, and pid 5318 14:15:47.421535-0700
fileproviderd   com.apple.FileProvider.LocalStorage providing <private> for claim 97D67388-49D7-4076-9622-0FD18C9DE063  14:15:47.421832-0700
fileproviderd   com.apple.FileProvider.LocalStorage began providing 14:15:47.421853-0700
filecoordinationd   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 invoked in server    14:15:47.421862-0700
myAppName   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 granted in client    14:15:47.421880-0700
myAppName   Claim D578716E-D91A-4ECB-9348-CF9824341DA9 invoked in client    14:15:47.421923-0700