I have tried the followings:
removing derived data, clean up project, restart - doesn't work
change deployment target to latest - doesn't work
turn off and on setting in Text Editing - no luck ....
and then I tried to delete the core data (.xcdatamodeld) file and recompile, it works magically! And then I add the core data file back, add an Entity to it, compile, does not work again! Magically when I delete it again, it works again!
Anyone has any idea?
By the way, this is macOS project, not iOS.
Thanks
Just right click and delete the xcdatamodelid file, and add it back, then add it to Copy Bundle Resources list, then it works fine...