I am trying to make a build of my app with Xcode cloud, but an unknown error popped to me that I don’t really understand: Main actor-isolated property ‘mainContext’ can not be referenced from a non-isolated context.
this comes from my @main file, and sends me to this part of my code:
<code>private func setupWorkoutHistoryManager() {
if workoutHistoryManager == nil {
workoutHistoryManager = WorkoutHistoryManager(modelContext: container.mainContext)
}
}
</code>
<code>private func setupWorkoutHistoryManager() {
if workoutHistoryManager == nil {
workoutHistoryManager = WorkoutHistoryManager(modelContext: container.mainContext)
}
}
</code>
private func setupWorkoutHistoryManager() {
if workoutHistoryManager == nil {
workoutHistoryManager = WorkoutHistoryManager(modelContext: container.mainContext)
}
}
in the same file, I use this function like this for both my root view and welcomes screens:
Everything works fine on the simulator, this is the only error of my build which prevent me to export it.
2