Passing Objects with segue and editing safely. #226

Closed
opened 2025-12-29 15:26:59 +01:00 by adam · 1 comment
Owner

Originally created by @tosbaha on GitHub (Aug 20, 2018).

Hi,
In usual master detail view application, I have ListMonitor and I am passing objects to detail view controller with a segue. If I edit the object with

 Storage.stack.perform(asynchronous: { transation -> Void in
       let editable = transation.edit(object)!
       editable.property = value
}

It successfully edits the object but the changes are not seen immediately. I have to refresh the object by going back and forth. However if I directly edit the object like object.property = value changes are seen immediately. Documents says that we should use the edit. How should I proceed?

Originally created by @tosbaha on GitHub (Aug 20, 2018). Hi, In usual master detail view application, I have ListMonitor and I am passing objects to detail view controller with a segue. If I edit the object with ```swift Storage.stack.perform(asynchronous: { transation -> Void in let editable = transation.edit(object)! editable.property = value } ``` It successfully edits the object but the changes are not seen immediately. I have to refresh the object by going back and forth. However if I directly edit the object like `object.property = value ` changes are seen immediately. Documents says that we should use the edit. How should I proceed?
adam closed this issue 2025-12-29 15:26:59 +01:00
Author
Owner

@tosbaha commented on GitHub (Aug 21, 2018):

I found my error. I had to wait for asynchronous operation to finish and call tableView.reloadData inside the completion block.

@tosbaha commented on GitHub (Aug 21, 2018): I found my error. I had to wait for `asynchronous` operation to finish and call `tableView.reloadData` inside the completion block.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#226