1 Reply
      Latest reply on Dec 28, 2016 4:12 PM by eskimo
      Folbo Level 1 Level 1 (0 points)


        I think that I am missing a step ...


        1. Create a new iOS project ... iOS Single View application; language:Swift, and Use Core Data,
        2. With the datamodel file, add an Entity 'MyTestEntity' with two attibutes, age (int64) and name (string)
        3. Editor Menu ... Create NSManagedObject Subclass... Next/Next/Create (boxes all ticked on the way through)
        4. Two files are created both with errors al over the place






        I can only assume that I have missed a step ... because I would not expect Xcode generated code to have errors ... unless it is looking for something that I have forgotten to do!



        • Re: Newbie Question: Errors in Xcode generated code ... why?
          eskimo Apple Staff Apple Staff (13,915 points)

          The simple answer here is that you don’t need step 2.  By default a new entity is set up so that Xcode manages all of its source code internally; you don’t need to create the .swift files via Editor > Create NSManagedObject Subclass.

          You can change this policy via the Codegen popup in the data model inspector but if you’re just getting started it’s easier to stick with the default.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"