Why is the extension of my Swift class not visible outside the defining file?

前端 未结 2 1871
Happy的楠姐
Happy的楠姐 2021-01-07 17:54

I have an Xcode-generated NSManagedObject class for my CoreData model.

@objc(SomeClass) class SomeClass : NSManagedObject { /* ... */ }

It

相关标签:
2条回答
  • 2021-01-07 18:23

    It sounds like your new file (SomeClassExtension.swift) didn't get included in the correct target. Double-check the file's target membership by selecting the file in Xcode, then opening the "File Inspector" (View menu > Utilities > Show File Inspector). Make sure the correct targets are checked under the Target Membership heading.

    0 讨论(0)
  • 2021-01-07 18:37

    I don't see any public modifiers on those methods.

    0 讨论(0)
提交回复
热议问题