mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Getting a serious fault when trying to pass in an entity object from one ViewController to another. #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Dec 8, 2016).
So i have a button in the first view controller that when pressed, creates an entity friend like so:
class secondvc() {
var friend: Friend!
}
In the second view controller, if I try to access the value friend, its nil. I 'am absolutely positive that it is indeed saving since I can access the value in the first view controller (if i were to print it in the commit completion handler, it would give a value, but in the second vc, its nil). I have found a workaround to this which is just to fetch the friend in the second view controller. However, I 'am very curious as to what the problem is and how to go about fixing it. This framework is so powerful that I want to know how to fully manipulate it. Thank you !
@ghost commented on GitHub (Dec 8, 2016):
And i forgot, a fault does print out when passing friend to the second view controller when I try to print(self.friend) in the second vc
@JohnEstropia commented on GitHub (Dec 8, 2016):
Hi, you are passing a transaction-only instance which would be invalid after commit().
try
@ghost commented on GitHub (Dec 8, 2016):
worked like a charm, thank you very much !
@JohnEstropia commented on GitHub (Dec 8, 2016):
Glad it worked :)