Tôi nhận được lỗi này dường như cảnh báo tôi về các tệp trùng lặp. Tôi thiếu một cái gì đó hoặc Xcode bây giờ không yêu cầu tạo phân lớp nsmanaged để hoạt động trên dữ liệu cốt lõi. Tôi đã thử tạo một dự án trống và điều tương tự cũng xảy ra. Đây là dữ liệu lỗiLỗi khi tạo Lớp con NSManaged trong Xcode 8.2 beta
<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
Điều này ngụ ý rằng các tệp đã được tạo tự động. Tôi thậm chí có thể tạo một đối tượng Thẻ mà không cần tạo các lớp con theo cách thủ công. Cảm ơn.
Kiểm tra: http://stackoverflow.com/a/40357746/1457385 và có thể http://stackoverflow.com/a/39933534/1457385 – shallowThought
Tôi đã kiểm tra cả hai, đã thử và vẫn gặp lỗi . Bây giờ tôi đã tạo một ứng dụng mà không tạo các lớp con và nó hoạt động. Vì vậy, tôi đoán họ đang thực hiện các lớp con coredata tự động bây giờ? – user3739902
Tùy thuộc vào cài đặt của bạn. Nó được giải thích chi tiết trong các câu trả lời được đề cập. Bạn cũng có thể muốn xem video WWDC "Có gì mới trong Dữ liệu chính": https://developer.apple.com/videos/play/wwdc2016/242/ – shallowThought