重複ファイルを警告するようなエラーが表示されています。何か不足しているか、Xcodeはコアデータを操作するためにnsmanagedサブクラスを作成する必要はありません。私は空のプロジェクトを作成しようとしたが、同じことが起こる。ここにエラーデータがありますXcode 8.2ベータ版でNSManaged Subclassを作成するとエラーが発生する
<unknown>:0: error: filename "Card+CoreDataClass.swift" used twice: '/Users/user/Documents/Developer/coredata/Card+CoreDataClass.swift' and '/Users/user/Library/Developer/Xcode/DerivedData/coredata-gicbdltjgiidbcfxaqqaxvkqwnnk/Build/Intermediates/coredata.build/Debug-iphonesimulator/coredata.build/DerivedSources/CoreDataGenerated/coredata/Card+CoreDataClass.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
<unknown>:0: error: filename "Card+CoreDataProperties.swift" used twice: '/Users/user/Documents/Developer/coredata/Card+CoreDataProperties.swift' and '/Users/user/Library/Developer/Xcode/DerivedData/coredata-gicbdltjgiidbcfxaqqaxvkqwnnk/Build/Intermediates/coredata.build/Debug-iphonesimulator/coredata.build/DerivedSources/CoreDataGenerated/coredata/Card+CoreDataProperties.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
これは、ファイルがすでに自動的に作成されていることを示しています。サブクラスを手動で作成せずにCardオブジェクトを作成することもできます。ありがとう。
チェック:http://stackoverflow.com/a/40357746/1457385、多分http://stackoverflow.com/a/39933534/1457385 – shallowThought
私は両方をチェックしてみましたが、まだエラーがあります。私は今、サブクラスを生成せずにアプリを作ったし、それは動作します。だから私は彼らがcoredataのサブクラスを自動的に実装していると思っていますか? – user3739902
設定に応じて。それは、上記の答えで詳しく説明されています。 WWDCのビデオ「コアデータの新機能」もご覧ください:https://developer.apple.com/videos/play/wwdc2016/242/ – shallowThought