0

I just wanted to ask if is there a way to create a String Array in Core Data without using relationships because I kinda not like them it seems to complicated too me.

If it is a way which one?

Fovu
  • 71
  • 6
  • What you are looking for is a transformable property or converting the array to json and storing it as a Data attribute, see for instance [this answer](https://stackoverflow.com/a/57705721/9223839) – Joakim Danielson Dec 18 '21 at 16:35
  • Thanks buddy you helped me! – Fovu Dec 18 '21 at 17:04
  • Rather than *objective-c-ish* transformable in Swift I'd prefer to declare the attribute as `String` and create a computed property for the conversion from and to JSON with `Codable`. Another benefit is that a JSON **string** is searchable. – vadian Dec 18 '21 at 17:31
  • Yh I though of that too but while trying to do it I was encountering some problems when i fetched them so I wanted to try another way, thanks for the anser tho. – Fovu Dec 20 '21 at 10:07

0 Answers0