iPhone OS 3.2 文件共享路径

发布于 2024-09-03 12:17:23 字数 464 浏览 4 评论 0原文

目前我的文件路径和文件有这个...

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔落惊风雨 2024-09-10 12:17:23

在类 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 type Shared\\PartyPlanner.sqlite if you really need a backslash in the file name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文