Note. This was tested on Xcode 6.4 and Xcode 7 beta 3. As with Xcode 7 beta 4, there seems to be a built-in solution, and manually creating the file no longer works - see accepted answer
Open a terminal and go to the project directory and model file - your command should look something like this:
cd /Users/YOU/Documents/MyProject/MyProject/MyDataModel.xcdatamodeld
Now list the entire directory contents of your data model:
ls -la
If you do not see a file named ".xccurrentversion", you must create it.
nano .xccurrentversion
Copy / paste the required XML for the model version:
<?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>YOURDATAMODELNAME.xcdatamodel</string> </dict> </plist>
Replace YOURDATAMODELNAME with the name of the data model directory, minus the extension (for example, MyDataModel.xcdatamodeld -> MyDataModel).
Now, probably, you will need to fix the permissions for the file:
chmod 775 .xccurrentversion
.. This is enough.
Clean the project, restart Xcode, rebuild - the warning should disappear.
Largely compiled from this thread, with some additional restrictions + permissions: https://forums.developer.apple.com/thread/8861
Sitric
source share