title: SwiftUI 2.0 CoreData issues with new project - 'Cannot find type 'Item' in scope'
body: <p>[EDIT] I was hoping that Apple would have fixed what is obviously a bug. The solution is to clear the cache, close and reopen Xcode..</p>
  <p>I am on Xcode Beta and starting a new project and without writing a single line of code I already get an error. I could not find anything online. Perhaps is this too new?</p>
  <p>In the new version of Xcode I selected new Project,</p>
  <p><a href="https://i.stack.imgur.com/IjOLd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IjOLd.png" alt="selecting new project" /></a></p>
  <p>then ticked the box with Core Data</p>
  <p><a href="https://i.stack.imgur.com/opll1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/opll1.png" alt="ticking the box Core Data" /></a></p>
  <p>If I do not tick the box I would get the usual Xcode SwiftUI template with &quot;hello world&quot;, but ticking the Core Data box I get a ton more template code from Apple and without touching anything and without changing a single line of code, I get an error message compiling it..</p>
  <p><a href="https://i.stack.imgur.com/ph6kk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ph6kk.png" alt="Error" /></a></p>
  <p>The error is: &quot;Cannot find Item in scope&quot;</p>
  <p>Quite frustrating, especially because all tutorials I have start with the classic 'AppDelegate' file configuration.. while the new SwiftUI is 'universal'!</p>
  <p>I checked the file <code>.xcdatamodeld</code> and it looks fine, and has the 'Item' entity. Why it doesn't compile?</p>
  <p>So I am now at a loss, is there a solution or this is a bug and need to wait that Apple releases a fix. If so I do not need to start with a new project until then!</p>
  <p>PS Today I cleaned the cache with CMD-ALT-SHIFT-K, closed Xcode, deleted the app from the simulator, reopened, rebuilt and it did compile.. but nothing in the simulator! We are making progress! Still I did not change a line of code. Everything is the Apple template yet!</p>
  <p><a href="https://i.stack.imgur.com/jNkH5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jNkH5.png" alt="enter image description here" /></a></p>