ios_catalogue1-3 Exercise 1: Container, Seeding and Preview ============================================================ Expected after deleting the old app and running: First launch: the temporary list shows the section "Item types" with Book, CD, DVD, Blu-ray, in that order (sortOrder 0..3), and an empty "Tags" section. After relaunch: the same four, not eight: ensureSeeded() counts first and does nothing when types exist. Canvas preview: the four types, plus the tags sci-fi, classic and jazz. "sci-fi" appears ONCE although Dune and Alien both use it (tag(named:) found the existing tag the second time). Typical errors and causes: Crash at launch mentioning a schema or store error The old store (from before sortOrder was added) does not match the new model. Delete the app from the simulator (or Device > Erase All Content). "Cannot find 'RootView' in scope" RootView.swift missing or not in the app target. "Cannot convert value ... #Predicate" The predicate calls a function (Tag.key(for:)) inside the closure. Compute `let key` first. "Call to main actor-isolated ... in a synchronous Swift concurrency checking in your Xcode's language nonisolated context" mode: mark the type or function @MainActor, or move the call into .task { }. Canvas crashes on opening Read the diagnostic: usually a relationship or container problem. Try the app first; if the app runs and the canvas does not, check that the preview uses the SHARED container, not a new one. Preview shows a tag twice tag(named:) is not being used by save(_:tagNames:). Your own list will differ with your Xcode version. If the canvas fails but the simulator works, remember that previews are a separate process with their own quirks (the sources report several).