Post

Replies

Boosts

Views

Activity

@StateObject for view owning "viewModel" to use with @Observable observation framework object
I have an issue with a View that owns @Observable object (Instantize it, and is owner during the existence) in the same notion as @StateObject, however when @State is used the viewModel is re-created and deallocated on every view redraw. In the previous models, @StateObject were used when the View is owner of the object (Owner of the viewModel as example) When @Observable object is used in the same notion, @State var viewModel = ViewModel() the viewModel instance is recreated on views redraws. @StateObject was maintaining the same instance during the View existence, that however is not happening when used @Observable with @State.
2
1
2k
Sep ’23
@StateObject for view owning "viewModel" to use with @Observable observation framework object
I have an issue with a View that owns @Observable object (Instantize it, and is owner during the existence) in the same notion as @StateObject, however when @State is used the viewModel is re-created and deallocated on every view redraw. In the previous models, @StateObject were used when the View is owner of the object (Owner of the viewModel as example) When @Observable object is used in the same notion, @State var viewModel = ViewModel() the viewModel instance is recreated on views redraws. @StateObject was maintaining the same instance during the View existence, that however is not happening when used @Observable with @State.
Replies
2
Boosts
1
Views
2k
Activity
Sep ’23
Xcode 11 unresponsive when trying to create any new project, Catalina
HelloI installed calatina and latest xcode, but i am unable to create any project with xcode. The xcode gets unresponsive everytime I want to create a new file or project. I can open existing projects but cannot create any file. Anybody gets the same issue?
Replies
7
Boosts
0
Views
5.3k
Activity
Jun ’22