Whiffer / SwiftUI-Core-Data-Test

Sample program to demonstrate how CoreData can be used with SwiftUI.
153 stars 19 forks source link

a core data question in SwiftUI #6

Closed buibuibui404 closed 4 years ago

buibuibui404 commented 4 years ago

Hi, Whiffer

I encounter a bug and I suppose it caused by core data. I put my questions on StackOverflow. Could you help me? 🥺

https://stackoverflow.com/questions/59727038/swiftui-precondition-failure-attribute-failed-to-set-an-initial?noredirect=1#comment105604327_59727038

Whiffer commented 4 years ago

I have had that same issue in the past, but don't remember the specific reason or solution. My recollection is that it was more of making an invalid assumption of how SwiftUI works than a Core Data issue. I might be able to debug it again, but I would need a complete minimal working/compilable sample that demonstrates the failure. I suggest making a copy of your project and start deleting as much as you can that is not directly related to the failure. Also, simplify/eliminate any data structures that are not directly related to the failure. Then, post the complete minimal sample project on GitHub and put a link to it in your StackOverflow question. That will make it much easier for people to help you.

buibuibui404 commented 4 years ago

I have had that same issue in the past, but don't remember the specific reason or solution. My recollection is that it was more of making an invalid assumption of how SwiftUI works than a Core Data issue. I might be able to debug it again, but I would need a complete minimal working/compilable sample that demonstrates the failure. I suggest making a copy of your project and start deleting as much as you can that is not directly related to the failure. Also, simplify/eliminate any data structures that are not directly related to the failure. Then, post the complete minimal sample project on GitHub and put a link to it in your StackOverflow question. That will make it much easier for people to help you.

Thank you so much, I fixed this bug successfully 👍 :)