2

I am trying to learn CoreData. I created a single entity with only one attribute and created it's NSManagedObject using the Editor menu.

But as soon as I try to build the app I am shown a Swift Compiler Error

File Structure:

enter image description here

Data.xcdatamodeld: enter image description here

Error: enter image description here

Supratik Majumdar
  • 2,365
  • 1
  • 23
  • 31

2 Answers2

1

You are manually generating a NSManagedObject subclass, which has already been generated by Xcode.

Find detailed solutions here.

Community
  • 1
  • 1
shallowThought
  • 19,212
  • 9
  • 65
  • 112
1
  1. Select your entity(Item) -> Goto Data Model Inspector -> Under Class -> Select Codegen -> choose Manual/None.

  2. Now Restart your XCode.

FYI check below image.

enter image description here

I have created simple core data app which helps you to understand basics of how to insert data, delete and update.

take a look here.

Ashok R
  • 19,892
  • 8
  • 68
  • 68