'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

与世无争的帅哥 提交于 2021-02-18 10:10:22

问题


I'm receiving a message in the log saying

'bundleNamePlaceholder'[8424:100146] [general] 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

The message is not clear to me but I'm assuming that it might be something related to a CoreData object or maybe its content

Is there a way to catch what's throwing this message or what might cause it?


回答1:


apple is removing NSKeyedUnarchiveFromData at some point because it's not secure by default. if you're storing a transformable value using NSKeyedUnarchiveFromData in coredata, it will then become unreadable.

https://www.kairadiagne.com/2020/01/13/nssecurecoding-and-transformable-properties-in-core-data.html

and https://developer.apple.com/forums/thread/107533




回答2:


To find out what is causing these log messages, try adding symbolic break points for

+[NSKeyedUnarchiver unarchiveObjectWithData:] and

+[NSKeyedUnarchiver unarchiveTopLevelObjectWithData:error:]

This helped me help finding the culprit.



来源:https://stackoverflow.com/questions/62589985/nskeyedunarchivefromdata-should-not-be-used-to-for-un-archiving-and-will-be-re

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