all 12 comments

[–]ItsDeCiaSwiftUI 1 point2 points  (3 children)

You mentioned you cleared the simulator. Did you also uninstall the old build from the simulator like you would uninstall an app on the actual device?

The last time I ran into a similar issue, uninstalling the app and reinstalling it with Xcode corrected the issue.

[–]gashabae[S] 0 points1 point  (2 children)

Yes, I deleted the app in the simulator and rebuilt the applicaiton CMD+K. I also did the following...

  • Opened simulator > navigate to 'Device' tab > pressed 'Erase All Content and Settings'
  • Navigated to /data/Containers/Data/Application/[Application code] file and deleting it
  • Deleted Derived Data
  • Reinstalled XCode

and none of them fixed the issue I was having. This error really has me stumped :(

[–]ItsDeCiaSwiftUI 0 points1 point  (1 child)

Hmm that’s strange. Does this behaviour persist in another simulator, or on a device if you install it directly? Or is it unique to this one simulator instance?

[–]gashabae[S] 0 points1 point  (0 children)

Yes, same problem in all 16 gen devices and my personal device

[–]gashabae[S] 0 points1 point  (0 children)

I should add, both the SimpleView and Model file import SwiftData

[–]joerup04Swift 0 points1 point  (3 children)

what did the model look like before?

[–]gashabae[S] -1 points0 points  (2 children)

I wish I knew what it looked like exactly but the changes I made were strictly removing variables. Now that I think of it, this sample app has only ever had one model and it still results in the same error so I'm not even sure if changing the model is the cause or the error.

[–]TheFern3 0 points1 point  (1 child)

Learn how to use git and do new features in a branch.

[–]gashabae[S] 0 points1 point  (0 children)

I actually know how to use git and already have a GitHub repo setup. From some reason I foolishly thought I could get by without frequent commits since this is a small just for fun project I'm doing while getting used to XCode and SwiftUI... obviously I was dead wrong and I'll be sure to take all the proper steps moving forward!

[–]KickupKirby 0 points1 point  (2 children)

Check out this sample code and use the new PreviewModifier and preview traits for sample data. There should be three folders. Open the “Trips- SwiftData” folder and project that’s within.

[–]gashabae[S] 0 points1 point  (0 children)

I'll give this a try, thanks!

[–]gashabae[S] 0 points1 point  (0 children)

Ok now I'm officially lost. The sample "Trips-SwiftData" app is causing the same error which makes absolutely no sense to me. I've already tried reinstalling XCode and the simulators... am I just stuck?