0

I have poured over this for hours and I can say with 99% certainty that I know what is breaking but I don't know why or how to fix it.

    @State private var timeSet = false {
        willSet {
            if newValue {
                flyingHours = timeMachine.calculateTotalFlightHours()
            }
        }
    }

The code above stops working when I use AddSortie().environment(\.managedObjectContext, self.moc) with the button to trigger the popover. timeSet never becomes true, or if it does it very quickly resets to false.
However, by leaving off the .environment AddSortie() timeSet does become true at the appropriate time and the app works as expected... Except without .environmtnt I can not save to CoreData.
Any ideas?
For what it's worth I am working in XCode 12 Beta 2
Thanks

dRod
  • 11
  • 1
  • [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Asperi Jul 23 '20 at 04:58
  • Thanks. I’ll update the post with more code. I was just trying to stick to the core of the issue. – dRod Jul 23 '20 at 11:57

0 Answers0