Gru*_*kes 1 database core-data ios
我刚刚开始学习CoreData for iOS,并编写了一些探索性代码来存储(通过ManagedObjectContext保存)并成功读取数据.
但是我在文件中有很多数据,但是想从头开始,所以我想在文件系统中手动删除它.但它的名字/位置是什么?我无法通过手动浏览看到任何看起来像这样的东西,虽然我还没有读完关于核心数据的书,但是浏览它我找不到任何对这类信息的引用.
TIA
该文件位于iPhone模拟器的应用程序目录中,例如 /Users/matthias/Library/Application Support/iPhone Simulator/5.0/Applications/EB33C087-A250-483E-96DD-D265ED3F0985/Documents/Foobar.sqlite
只需将一个NSLog放在persistentStoreCoordinator getter中即可查看确切位置.
像这样:
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
/* ... */
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Foobar.sqlite"];
NSLog(@"CoreData Location: %@", storeURL);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6315 次 |
| 最近记录: |