2010-05-31 115 views
0

目前我有這對我的文件的路徑和文件...iPhone OS 3.2文件共享路徑

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

這讓我分享與iTunes的文件,而是僅僅具有「PartyPlanner.sqlite」在「applicationDocumentsDirectory \共享」

我有「SharedPartyPlanner.sqlite」在「applicationDocumentsDirectory」

是有一個更清潔或更容易的方式來獲得共享文件夾applicationDocumentsDirectory裏面?

回答

1

在類UNIX系統(包括iPhone OS)中,目錄分隔符是/,而不是\。另外,在類似C的語言(包括Objective-C)中,字符串中的\被用於轉義字符,例如,字符串中的\\n →一條新線。如果您確實需要文件名中的反斜槓,則需要輸入Shared\\PartyPlanner.sqlite

+0

非常感謝。 – OscarTheGrouch 2010-05-31 12:57:50