I had problems with an app I'm building and got numerous errors with cocoapods and incompatible build settings . I decided to start again and build the app back up from scratch. I managed to copy almost all files from the old to the new app and got it building successfully. I read a few SO pages (ie copy coredata, another that imply that I can also easily copy over the coredata xcdatamodel file and seeing I don't have any significant amount of data in the model I decided to try it (its the data structure that I'm trying not to have to write out again rather than the data itself).
I dragged and dropped the old xcdatamodeld file from the old app to the rebuilt app but when I ran again it gives me an error on the line
let modelURL = NSBundle.mainBundle().URLForResource("myAppName", withExtension: "momd")!
with error message "fatal error: unexpectedly found nil while unwrapping an Optional value"
I then noticed that when I copied over the myAppName.xcdatamodeld file from the old app to the new rebuild ... it copies it over as myAppName.xcdatamodel ie without the d at the end. Ive tried deleting and copying over again and it does the same each time. Any ideas on what the problem is and how I can copy the coredata structure over sucessfully?
i ended up recreating the coredata store manually but if i need to do next time ill try copying it via finder rather than xcode as you suggested. thx for help and detailed instructions