How to store CLLocation using Core Data (iPhone)?

前端 未结 5 1907
故里飘歌
故里飘歌 2021-01-30 01:41

I\'m trying to save a location and retrieve the location on a map afterward using Core Location, MapKit and Core Data frameworks.

What I\'ve done is I just made entity

5条回答
  •  悲&欢浪女
    2021-01-30 02:35

    You can do this very simply just by setting the Core Data attribute type to Transformable. The default transformer if you leave the Value Transformer Name blank is NSKeyedArchiver which works with most Foundation types such as NSURL and CLLocation.

提交回复
热议问题