Post

Replies

Boosts

Views

Activity

Reply to NSStagedMigrationManager Merging Steps
There was a few issues here. None of which are documented very well. And all crash with the same error message. (1) My orginal .xcdatamodel file didn't have a Core Data Model Identifier. Which lead to a crash with NSCustomMigrationStage, even though the versionChecksum are different. (2) The steps passed into NSStagedMigrationManager are not clear or documented. But it appears that if you pass the first version of the model into the steps, it crashes. (3) I'm using manual code generation for the model classes. So my goal was to switch the model names, then switch them back, so I didn't have to change anything. For some reason, stepping through the one migration step per app launch instead of all at once allowed for a successful migration. But running all steps threw an error. Turns out I could just rename the model classes with the _v2 suffix, and the only thing I needed to update was the string in the fetch request. Overall, to resolve this I added a model version identifier I duplicated the model version and incremented the model version identifier Deleted the final migration step that removed the entity versioning
1w
Reply to Background Assets Directory Collision
The system effectively merges all of your asset packs into a single directory hierarchy. You can think of it as your app’s single, shared asset-pack namespace. The system expects that every individual file have a relative path from the root of that shared namespace that’s unique across all of your app’s asset packs (though not necessarily across multiple apps). An asset pack’s ID is not part of the unique path, but every other path component is. In your case, Foo/10/239/414.png and Bar/10/239/414.png are distinct paths that shouldn’t collide. This is also what I suspected from observation. That also actually works out great for something like map tiles, unless there are duplicate files. I would much prefer to just list the images as z/x/y.png, but duplicates appear to resolve in an error. I suspect that you’re testing your app on OS 26, not OS 26.1. There’s a known issue with AssetPackManager.url(for:) in OS 26 that we fixed in OS 26.1 beta I was testing with 26.0.1. I'll upgrade and give it a go! Thank you for the quick reply!
Oct ’25