Group Group Group Group Group Group Group Group Group

Chapter 11 some issue in beginning (resolved)

In the beginning, I create the TaterRater.xcdatamodeld, then remove the Potato.swift file. the book say:

"Build and run your project. It will crash, but at runtime. Does that surprise you? You removed the Potato.swift file and you haven’t generated an NSManagedObject subclass file yet, but your app built just fine. What’s happening?

Xcode now automatically generates the code to implement your subclasses. It puts the generated files into the Derived Data folder for the project, to further underline the idea that you’re not supposed to be editing them yourself. It does this every time you change the model file."

But, I run project, it crashed actually. The error message:

2016-11-30 20:28:57.097436 TaterRater[2787:113192] [error] error: CoreData: error: Failed to call designated initializer on NSManagedObject class ‘Potato’
2016-11-30 20:28:57.097 TaterRater[2787:113192] -[Potato setVariety:]: unrecognized selector sent to instance 0x6000000a4500

my fault,it say built not running …