I am using unarchiveObjectWithData
to unarchive data from NSUserDefaults
and it is working good, but it was deprecated in iOS 12.0.
Xcode suggests
I faced up with an issue and follow the @Darren answer, but unarchivedObjectOfClass returns nil ! :(
so i tried a lot of variation and found the only success way is my case:
supportsSecureCoding property must be YES
and
NSArray *arrayOfCustomObjects = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSObject class] fromData:data error:&error];