iPhone OS 3.2文件共享路径
-
05-10-2019 - |
题
目前,我为文件路径和文件提供了此功能...
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Shared\PartyPlanner.sqlite"]];
这使我可以与iTunes共享该文件,而不仅仅是在'applicationDocumentsDirectory shared'中使用partyplanner.sqlite'
我在'applicationDocumentsDirectory'中有“共享partyplanner.sqlite”
是否有更清洁或更轻松的方法可以进入ApplicationDocumentsDirectory内部的共享文件夹?
解决方案
在类似Unix的系统(包括iPhone OS)中,目录分离器为 /
, , 不是 \
.
另外,使用C型语言(包括Objective-C), \
在字符串中用于逃避角色,例如 \n
→一条新线。您需要输入 Shared\\PartyPlanner.sqlite
如果您确实需要在文件名中的后斜线。
不隶属于 StackOverflow