I want to store an array of CLLocationCoordinate2D
in Core Data but this error always appears while executing the code
Thread 1: signal SIGABRT
As the error says in the console:
this archiver cannot encode structs
CLLocationCoordinate2D
is a struct. Core Data can only store basic types like dates, numbers, data, strings etc. If you want to store a location coordinate just store its components (simply latitude and longitude) as doubles, and you can write a supporting method to initialize the CLLocationCoordinate2D
struct from the numerical values.