iPhone OS 3.2 文件共享路径
目前我的文件路径和文件有这个...
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Shared\PartyPlanner.sqlite"]];
这允许我与 iTunes 共享文件,但不是在“applicationDocumentsDirectory\Shared”中只有“PartyPlanner.sqlite”,而是在“applicationDocumentsDirectory\Shared”
中有“SharedPartyPlanner.sqlite” applicationDocumentsDirectory'
有没有更干净或更简单的方法来访问 applicationDocumentsDirectory 内部的共享文件夹?
Currently I have this for my file path and file...
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Shared\PartyPlanner.sqlite"]];
This allows me to share the file with iTunes, but instead of just having 'PartyPlanner.sqlite' in the 'applicationDocumentsDirectory\Shared'
I have "SharedPartyPlanner.sqlite" in the 'applicationDocumentsDirectory'
is there a cleaner or easier way to get to the shared folder inside of applicationDocumentsDirectory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在类 UNIX 系统(包括 iPhone OS)中,目录分隔符是
/
,而不是\
。另外,在类 C 语言(包括 Objective-C)中,字符串中的
\
用于转义字符,例如\n
→ 换行。如果您确实需要在文件名中包含反斜杠,则需要输入Shared\\PartyPlanner.sqlite
。In UNIX-like systems (including the iPhone OS), the directory separator is
/
, not\
.Also, in C-like languages (including Objective-C), the
\
in a string is used to escape a character, e.g.\n
→ a new line. You need to typeShared\\PartyPlanner.sqlite
if you really need a backslash in the file name.