NSDictionary with NSDates as keys

心已入冬 提交于 2019-12-05 18:32:30
Jens Ayton

Not using property lists, as only string keys are allowed there. You should be able to write it using NSKeyedArchiver, but that has the disadvantage of being a more opaque format. Alternatively, you could of course make a copy of the dictionary where you convert the dates to strings.

Yes, this should work just fine - and NSDate elements are also suitable for plist encoding. Might depend on the value you put in as values, though.

If you experience problems, please update your question with code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!