How to NSKeyedUnarchiver.unarchiveObject

后端 未结 2 552
梦毁少年i
梦毁少年i 2020-12-11 17:11

I have a working code that works but deprecated:

This part is fine:

 let archived = try? NSKeyedArchiver.archivedData(withRootObject: [defaultRecor         


        
2条回答
  •  甜味超标
    2020-12-11 17:36

    The method above didn't worked for me for unarchiving, I did this and it worked:

    NSKeyedUnarchiver.unarchivedObject(ofClasses: [Record.self], from: archived)
    

提交回复
热议问题