|
Hi, Need some help on refreshing views with CoreData. I have a list of NSManagedObjects that show a card for each item. When selected it shows the detail view. I successfully save objects in the detail view and all of the CD items update correctly on both the detail view and list view. My problem is the card in the list view shows data based on the wrappedValues. That is not updating correctly. How do I refresh the display so that wrappedValues update? Here is my code for the List View:
Here is the code inside of LeadCard
|
|
|
|
Hi, So i viewed this link and it did not help? I am able to update attributes from the model with no problem. My challenge is that based on the updated new attribute I want to change an image presented. I am currently using a wrappedValue. The wrapped The List view does not update with the wrapped properties. Any help would be appreciated? Thanks |
|
|
|
Hi, Thanks. I didn't think we could make NSManagedObjects an ObservedObject? I did find a working solution below where a changed the CardView to recieve a binding NSManagedObject and it works well.
Inside LeadCard.
Thanks for your help, |
|
hi, for the record, the hope that helps, DMG |
|
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.