What do you expect with the code and what is the actual result?
Post
Replies
Boosts
Views
Activity
Unless you call reloadRows(at:with:) or reloadData() (generally, reloadData() is too much just for updating a single cell), UITableView would not update the cell, meaning tableView(_:cellForRowAt:) would not be called.
Thanks for trying, but your code causes bunch of errors and I cannot try it. Maybe this reactive publisher pattern is not good for using with SwiftUI. Or you can send a bug report to Apple, if you think it is a bug of SwiftUI.
Have noticed I have added @escaping on the first line?
You are using Float which is declared as Int16, so data.setValue(Float(collectionSize), forKey: "defaultSize") does not make sense. Do you really understand you cannot change the type of the attribute dynamically? And once I leave that view and come back, my update never got saved. It goes back to the original defaultValue., nothing sure can be said without seeing all the view transition codes.
Can you share the complete code which includes startAccessingSecurityScopedResource you tried?
It may be because your MyViewB is broken. Please show the complete code to reproduce the issue.
Please confirm, all the lines you have show here are placed in the same method? In which method you wrote these lines is very important to find what to change.
Is the information I provided here enough to be able to show that Far from enough. Please show your complete code, adding some images explaining how you have set up Core Data entities. Or you expect all the readers to read the same book?
Fragments of code does not help you finding what to change. container is not initialized, how and where are you setting it? Just before the save() is called? Or somewhere which may be called earlier? Please show the complete code.
I want to save the state when there is a change to the switch state You should better have clarified it in the opening post.
@EDD_HID, thanks for the info. I have read some reports that the similar error shown even when BUILD_LIBRARY_FOR_DISTRIBUTION is set. But could not find what would be the right solution for that. Anyway, you need to set BUILD_LIBRARY_FOR_DISTRIBUTION to YES to distribute a binary library, so please try and find info under that setting.
I mean the code including Section which you tried. Sorry, if my words were not enough.
I mean the code including Section which you tried. Or am I mistaking something and you have not tried Section yet?
You wrote my iOS app in your opening post, and there are no UIViewController available for Mac. What are you trying to do? You are not interested in using UIViewController any more?