TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Dictionary with Custom objects in CoreData

Forums > iOS

@00jim  

I have a dictionary with an Enum for use as the key and an array of cutom UIViews for the respective values in a dictionary.

This is proving to be hellish when comitting and retrieving with CoreData and I would like to know the best way to proceed.

At present I have been following Mr. Azam example of saving a UIColor as a Transformable type: https://www.youtube.com/watch?v=g6jBU8E1K2U

I decided that it may be best to create an entity for each of the custom Objects that I had and then a an entitiy with the Dictionary and place them in a relationship, but I haven't even been able to get the Objects coded, I keep getting the folliowing error about a missing NSValueTransformer reference, but I am sure that the name marry up: "CoreData: warning: no NSValueTransformer with class name 'CirclesTransformer' was found for attribute 'circle' on entity 'Circles'"

Any advice ?

2      

@00jim asks:

I have a dictionary with an Enum for use as the key and an array of cutom UIViews for the respective values in a dictionary.

Any advice ?

Yes! Show examples of this dictionary.

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.