Difficult to help without seeing any code, but that error generally means the View you're seeing the error in has no link back to the ApplicationData object that the View is trying to use.
For example:
// ApplicationData.swift
@Observable
class ApplicationData {
var someInteger: Int = 1
}
This creates an Observable object called ApplicationData. You can then use it with:
// MainApp.swift
@main
struct MainApp: App {
var body: some Scene {
WindowGroup {
let applicationData: ApplicationData = ApplicationData()
ContentView()
.environment(applicationData)
}
}
}
// ContentView.swift
struct ContentView: View {
@Environment(applicationData) var applicationData
var body: some View {
Text("someInteger = \(applicationData.someInteger)")
}
}
The error you're receiving is suggesting you haven't added something like line 8. That's required to bind the object you instantiated (in MainApp in this example, which is the view's ancestor) to the object you want to use in the View, at line 15.
Topic:
UI Frameworks
SubTopic:
SwiftUI