Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not determine generated file paths for CoreData code generation

While building my project for different target I am getting 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/abc/Documents/Code/xyz-ios/ABC/iPhoneXMPP/SRT/Model.xcdatamodeld:" UserInfo={NSFilePath=/Users/abc/Documents/Code/xyz-ios/ABC/iPhoneXMPP/SRT/Model.xcdatamodeld, NSLocalizedDescription=No current version for model at path /Users/abc/Documents/Code/xyz-ios/ABC/iPhoneXMPP/SRT/Model.xcdatamodeld:}

Path mentioned in error is "

/Users/abc/Documents/Code/xyz-ios/ABC/iPhoneXMPP/SRT/Model.xcdatamodeld

" but "SRT" folder is inside "Temp" folder in my folder structure. How can I resolve this issue?

like image 651
Sakshi Avatar asked Jan 09 '17 10:01

Sakshi


3 Answers

Similar to shallowThought's answer, I found I had to first uncheck the target, and then re-check it, and then re-build.

like image 76
Tim Newton Avatar answered Oct 17 '22 19:10

Tim Newton


In Xcode, select your Model.xcdatamodeld model and tick the checkbox "Target Membership" for your new target in the Inspector.

like image 27
shallowThought Avatar answered Oct 17 '22 17:10

shallowThought


In My Case it was a result of Model.xcdatamodeld having conflicts when Merged with Remote (Source or Head). Somehow this conflict wasn't detected by GIT and slid through as Conflict Free.

Resolution: Open Model.xcdatamodeld as xml (with textEditor) and search for conflicts (>>>). Fix conflict and Save.

like image 12
redEyeProgrammer Avatar answered Oct 17 '22 17:10

redEyeProgrammer