JavaEar 专注于收集分享传播有价值的技术资料

Could not determine generated file paths for Core Data code generation

I pulled my project from source tree to a new system. While trying to run the app the app build failed with error:

Could not determine generated file paths for Core Data code generation: Error Domain=com.apple.dt.ModelingTools Code=1 "Error, failed to read Core Data data model from /Users/mobtec_mac_mini/Work/Escaso/foodInfo.xcdatamodeld/foodInfo.xcdatamodel: unknown model format" UserInfo={NSFilePath=/Users/mobtec_mac_mini/Work/Escaso/foodInfo.xcdatamodeld/foodInfo.xcdatamodel, NSLocalizedDescription=Error, failed to read Core Data data model from /Users/mobtec_mac_mini/Work/Escaso/foodInfo.xcdatamodeld/foodInfo.xcdatamodel: unknown model format}

I can't select my foodInfo.xcdatamodel from the file browser it shows a dialogue box

The file “contents” couldn’t be opened because there is no such file..

I searched for the file in finder and found the file there. Tried deleting the file and replacing it with copy. But nothing seems to work. Please Help.

1个回答

    最佳答案
  1. Xcode is telling you that your model file is incomplete, or maybe corrupt. The xcdatamodel is a file package, which is a directory that Finder shows as if it were a file. You can inspect it by right-clicking on it and selecting "show package contents" from the pop up list.

    If the model is incomplete, you'll need to either get a complete copy from somewhere or else re-create the file.