获取Magical Record商店文件的路径

时间:2013-06-12 09:52:15

标签: ios6 nsfilemanager magicalrecord

获取 Cocoa错误260 ,表示找不到文件。

NSArray *inputPaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[[[NSPersistentStore MR_defaultLocalStoreUrl]absoluteString]stringByDeletingLastPathComponent]error:&folderError];
    if (folderError) {
        [SVProgressHUD showErrorWithStatus:folderError.localizedDescription];
    }

为什么呢?或者是获取商店文件路径的其他方式吗?

1 个答案:

答案 0 :(得分:0)

在这里找到答案:

NSURL path vs absoluteString

absoluteString仅适用于远程网址,因为本地文件网址应使用path代替。