Search code examples
ios6nsfilemanagermagicalrecord

Get paths for the Magical Record store files


Getting Cocoa error 260, which says file not found.

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

Why? Or is it any other way to get store files paths?


Solution

  • Found an answer here:

    NSURL path vs absoluteString

    absoluteString is for the remote urls only, for local file urls should be used path instead.