Was this code working previously for you, and now it has suddenly started crashing? When this has happened to me, it's always been because I made a change to my xcdatamodel without properly migrating it.
The quick fix is to rename your MyAppName.xcdatamodeld file. ie, change it to MyAppName2.xcdatamodeld. Then be sure to change it wherever it appears in your code, such as strings:
var coreDataStack = CoreDataStack(modelName: "MyAppName2")
Once you've got it working again, be sure to look up automatic lightweight migration of Core Data. Basically, any time you want to make changes to Core Data entities, you have to create a new version of your data model first. See this link for more info. iPhone Core Data "Automatic Lightweight Migration"