0

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

NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Shared\PartyPlanner.sqlite"]];

这使我可以与 iTunes 共享文件,而不是仅在“applicationDocumentsDirectory\Shared”中包含“PartyPlanner.sqlite”

我在“applicationDocumentsDirectory”中有“SharedPartyPlanner.sqlite”

是否有更清洁或更简单的方法可以访问 applicationDocumentsDirectory 中的共享文件夹?

4

1 回答 1

1

在类 UNIX 系统(包括 iPhone OS)中,目录分隔符是/,而不是\.

此外,在类 C 语言(包括 Objective-C)中,\字符串中的 in 用于转义字符,例如\n→ 换行。Shared\\PartyPlanner.sqlite如果您确实需要文件名中的反斜杠,则需要输入。

于 2010-05-31T04:24:40.983 回答