Xcode 8 generates broken NSManagedObject subclasses for iOS 10

后端 未结 22 906
栀梦
栀梦 2020-11-27 11:13

I updated my iOS app project recently to iOS 10. Now I\'m trying to change the Core Data Model of my app but the new NSManagedObject subclasses which Xcode generates are bro

22条回答
  •  死守一世寂寞
    2020-11-27 11:53

    Xcode 8.1 seems to be generating Model Class internally. Just delete the 2 classes created and you will still be able to use the entities in your code.

    Here's the error message I was receiving

    :0: error: filename "Recipe+CoreDataProperties.swift" used twice: '/Users/Rick/Desktop/Devslop/Rick Recipe/Recipe+CoreDataProperties.swift' and '/Users/Rick/Library/Developer/Xcode/DerivedData/Rick_Recipe-cctgjudvqobxlwetbcwmzrgxigwg/Build/Intermediates/Rick Recipe.build/Debug-iphonesimulator/Rick Recipe.build/DerivedSources/CoreDataGenerated/Rick_Recipe/Recipe+CoreDataProperties.swift'
    :0: note: filenames are used to distinguish private declarations with the same name
    Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
    

提交回复
热议问题