1

After creating my Data Model, I'm trying to create an NSManagedObject Subclass for an entity. In Xcode I click on the entity. Then from the Editor menu, I'm selecting Create NSManagedObject Subclass. The issue is the files are added outside the Project. I can't specify that they should be included in the Project Target. Screenshots below: enter image description here

enter image description here

Martin Muldoon
  • 3,388
  • 4
  • 24
  • 55
  • 1
    That is a new Xcode feature. See this answer: http://stackoverflow.com/a/40867271/1457385 – shallowThought May 03 '17 at 12:11
  • Thanks @shallowThought. What I ended up doing was simply creating two Swift files within my Project and copied the data out of the two files that were generated. – Martin Muldoon May 03 '17 at 13:20
  • I highly recommend against altering generated code in any way. Create the files manually if fine, I do recommend to use the new Xcode feature mentioned in the linked answer though. – shallowThought May 03 '17 at 13:33
  • I managed to resolve this. I'm using Cocoa Pods which creates a workspace. The reason my NSManagedObject files where not being included in the project was that they were being added to the workspace. I simply selected the project from the drop down and followed they instructions you sent. Thanks again! – Martin Muldoon May 03 '17 at 15:51

0 Answers0