Reputation: 87
I moved my Xcode file to iCloud Drive after I wanted to run the app and I got this Error:
Could not determine generated file paths for Core Data code generation: Error Domain=NSCocoaErrorDomain Code=260 "No current version for model at path /Users/sebastianeppler/Library/Mobile Documents/com~apple~CloudDocs/Xcode/OnlyFun/OnlyFun/OnlyFun/OnlyFun.xcdatamodeld:" UserInfo={NSFilePath=/Users/sebastianeppler/Library/Mobile Documents/com~apple~CloudDocs/Xcode/OnlyFun/OnlyFun/OnlyFun/OnlyFun.xcdatamodeld, NSLocalizedDescription=No current version for model at path /Users/sebastianeppler/Library/Mobile Documents/com~apple~CloudDocs/Xcode/OnlyFun/OnlyFun/OnlyFun/OnlyFun.xcdatamodeld:}
Upvotes: 4
Views: 6882
Reputation: 1311
I got this same error when I moved my Core Data Model to a different folder.
Go to your project file. In your Build Phases tab locate the model under Compile Sources and remove it. Then press + to add it back but DO NOT select it from the list you see right away (does not update the file path). Instead select "Add Other" and go select it from it's new location. Then leave the defaults of "copy if needed". Clean your build folder and you're good to go.
In my case this left me with 2 models in my property pane. I deleted the old and dragged and dropped the new one into the correct Xcode group. And all was right with the world again. Hope this helps someone else out.
Upvotes: 9
Reputation: 1
I have the same error.
I try to delete all sources file in Compile Sources
in tab: Build Phases
.
Then import all files again.
And selected Product
-> Clean
and Build
.
It worked with me.
I think everyone who have the same error could try do it!
Upvotes: -1
Reputation: 26
You are probabaly missing the file projectroot/MyProject/MyProject.xcdatamodeld/.xccurrentversion
If you can't recover it from your original, the format is like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>MyProject.xcdatamodel</string>
</dict>
</plist>
Upvotes: 1