2010-10-30 37 views
0

我已經添加了一個函數,以便我的數據庫駐留在設備上,但是,在模擬器中我根本找不到它。在我使用我的功能之前,它曾經在Machintosh HDiPhone,我的Mac上的我的SQLite數據庫?

+ (NSString*)getDBPath { 
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentsDirectory = [paths objectAtIndex:0]; 
NSString *dbPath = [documentsDirectory stringByAppendingPathComponent:@"bc.db"]; 
return dbPath; 
} 

回答

1

將存放在:

~/Library/Application Support/iPhone Simulator/<SDK>/Applications/<UUID>/Documents/bc.db 

<SDK>是代表你正在運行的模擬器版本的目錄。因此,例如,如果您在4.1模擬器中運行它,請將<SDK>4.1替換。

UUID由模擬器生成的和將是每次安裝該應用時間不同(即,打在Xcode「運行」按鈕)。要發現哪個應用程序是您正在使用的應用程序,只需輸入各種目錄並查看應用程序包的名稱即可。