I have added core data to my project and below is the code block of how it's section in pbxproj file looks like.
However whenever I make any changes to the project i.e. changing build version or adding a deleting new files to the project, I have noticed "name = "sample-app.xcdatamodeld";"
gets deleted automatically from the project file and I have to manually reverse that change.
Am I missing any setting for core data or is it a bug somewhere in XCode or Core Data? I am using XCode 15.
/* Begin XCVersionGroup section */
4683EC5B2C10F8B800A5081B /* sample-app.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
4683EC5C2C10F8B800A5081B /* sample-app.xcdatamodel */,
);
currentVersion = 4683EC5C2C10F8B800A5081B /* sample-app.xcdatamodel */;
name = "sample-app.xcdatamodeld";
path = "sample-app.xcdatamodeld";
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
I don't see the "name = <the model file name>" line is generated in any case (by following the steps you provided), though I am using Xcode 16, which may behave differently from Xcode 15.
Since the line is a part of the Xcode project file, Xcode folks will have the final answer. My best guess is that it is probably used by an earlier version of Xcode, but not any more by Xcode 16, and probably 15 as well given that Xcode 15 removes the line when you change the project settings. If you don't see that removing the line has any side effect, you can probably go ahead to do so.
Also, Xcode 16 is now RC. If it works for you without the line, I won't worry too much.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.