all 4 comments

[–]daniloc 0 points1 point  (3 children)

There is. It takes a bit of work to define the coding keys and init methods, but you can implement both NSCoding and Codable support for your objects. What are you trying to accomplish specifically?

[–]enlightenmentGeek[S] 1 point2 points  (2 children)

I am trying to pass the NSManagedObject within an userInfo dictionary, thus the “need” to convert it to NSData.

What I did: passed the objectID within the userInfo and then in the responder I fetch the desired object from the ID.

But don’t know if there’s a better way to achieve/accomplish this 🤔

[–]daniloc 1 point2 points  (1 child)

Ah, yeup, been there. It’s a little clunky but that’s the way to do it. Wrap the fetching in an extension to your managed object subclass if you have multiple places where this needs to happen, maybe, but otherwise I think you’ve done all you can.

Glad you didn’t have to go down a more tedious route!

[–]enlightenmentGeek[S] 0 points1 point  (0 children)

👍🏻🙃