Core Data Codegen fail in Xcode 8

后端 未结 6 1485
萌比男神i
萌比男神i 2021-02-04 05:01

I have an iOS app containing a Core Data model with 6 entities. The entity Name is set up as follows:

Class Name: Name

6条回答
  •  攒了一身酷
    2021-02-04 05:49

    Regarding problem 2: Core Data's "optional" flag has nothing to do with the Swift concept of an optional. They are unrelated and do not mean the same thing. Marking a Core Data attribute as non-optional does not imply that it's non-optional as Swift defines the term. The difference is:

    • Swift non-optionals must have non-nil values at all times.
    • Core Data non-optionals must have non-nil values when you save changes, but Core Data neither knows nor cares whether they're nil at other times.

    Problem #4 sounds like Xcode getting its state confused, and may be fixed by voodoo like manually clearing the derived data folder (again, I know). I can't currently reproduce it, but that doesn't mean it's not a bug in the current beta.

提交回复
热议问题