Need to archive CLLocation data

前端 未结 4 680
迷失自我
迷失自我 2021-01-12 21:37

I have an array of CLLocation data that I would like to archive. Should the NSUserDefaults system be used? Otherwise, how best to archive the

4条回答
  •  爱一瞬间的悲伤
    2021-01-12 21:59

    This is the usual method.

    CLLocation *myLocationToStore = ...; // (a CLLocation object)
    NSData *locationData = [NSKeyedArchiver archivedDataWithRootObject:myLocationToStore];
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题