Post

Replies

Boosts

Views

Activity

Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
u are just asking interesting question, but no any solution, I am asking questions not for my interest, but for finding solutions. And at last, you have shown a code which could be very helpful to find a solution. (Sorry, but may not be enough.) At a glance, I cannot find what's wrong and take some more time to explore.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
I tried your code and I could not reproduce the error No ObservableObject. I needed to guess many parts you have not shown, so that may be causing the difference. Once, again. Please show your code instantiating Main. (Please do not omit the declaration header, and please include all relevant codes.)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
Thanks for showing additional codes. But what relation are there between chatTopview or chatCell and already shown codes? In your actual project, chatTopview is the actual Main? Or something else? I cannot find any lines including Main(). Please understand, we readers do not have any info about what you want to do or how your project is made, Please, please show enough info, if you really want to collaborate with readers to solve your issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21