I added CoreData to my app MY_APP
:
- I defined the data model by creating a
xcdatamodeld
file containing a single entityXXX
with a few attributes. - Using Xcode/Editor/Create NSManagedSubclass, Xcode created 2 files,
XXX+CoreDataClass.swift
andXXX+CoreDataProperties.swift
. - I wrote a little code to test storage and fetch back from core data, and everything works fine.
The problem:
At the beginning of the build phase, I get 3 warnings:
warning: The Swift file "/Users/reiner/Library/Developer/Xcode/DerivedData/
MY_APP/Build/Intermediates.noindex/MY_APP.build/Debug-iphonesimulator/
MY_APP.build/DerivedSources/CoreDataGenerated/MY_APP/XXX+CoreDataClass.swift"
cannot be processed by a Copy Bundle Resources build phase (in target ‚MY_APP‘)
warning: The Swift file "/Users/reiner/Library/Developer/Xcode/DerivedData/
MY_APP/Build/Intermediates.noindex/MY_APP.build/Debug-iphonesimulator/
MY_APP.build/DerivedSources/CoreDataGenerated/MY_APP/XXX+CoreDataProperties.swift"
cannot be processed by a Copy Bundle Resources build phase (in target 'MY_APP')
warning: The Swift file "/Users/reiner/Library/Developer/Xcode/DerivedData/
MY_APP/Build/Intermediates.noindex/MY_APP.build/Debug-iphonesimulator/
MY_APP.build/DerivedSources/CoreDataGenerated/MY_APP/MY_APP+CoreDataModel.swift"
cannot be processed by a Copy Bundle Resources build phase (in target 'MY_APP')
These 3 files are not listed under MY_APP target/Build Phases/Copy Bundle Resources.
My questions:
Is anything wrong with my build setup, i.e. what is the reason for these warnings, and how can I avoid it?
Remark: This question relates to a different framework (core data), but is similar to this one, which does not have an answer yet.
EDIT:
My project has 2 targets, for iOS and for watchOS. Until now, core data was used only on iOS.
I tried now to enable it also for watchOS, but I got an error, because the .xcdatamodeld
was not yet in Build Phases / Copy Bundle Resources.
As soon as I added it there, core data was executed correctly on the watch.
BUT: I got the same 3 warnings mentioned above, this time additionally for the watch extension target (altogether 6 warnings).
Maybe this a useful hint.