core data use of undeclared type error iOS

Problem:

I had modified my entity properties and added new entity in my app with two extensions today extension and sharing extension.I had generated my NSManagedobject subclasses.But it shows error when i build the app like below.

"core data use of undeclared type" with my entity

Solution:

First you have to clear the derived data from xcode.
Goto xcode menu select preference - > select the menu "locations" -> click the small arrow near to the derived data path ->it will show you the derived data caches in the finder.

Delete the app data in derived data then close the xcode and reopen our project it will works.

If it shows the error again then follow the steps.

Select the xcdatamodeld -> in right side first menu "show file inspector"

Then check that under target membership your project and other extensions are checked.If not checked then do check them.

Also select all of your NSManaged object subclasses and do the same.Then only the problem will be solved.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift