I have the following warning (Xcode 10.1 - iOS 12.1)
'initForReadingWithData:' is deprecated: first deprecated in iOS 12.0 - Use -initForReadingFromData:error: instead*
When I'm change the method to initForReadingFromData, the NSKeyedUnarchiver returns nil.
// Current code which produces the warning (but works fine) :
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
NSMutableArray *loadedCredentialIdentities = (NSMutableArray *)[unarchiver decodeObjectForKey:kStoredCredentialIdentities];
[unarchiver finishDecoding];
...
// using initForReadingFromData produces no warning (but doesn't work - loadedCredentialIdentities is nil) :
NSError *error = nil;
NSKeyedUnarchiver *unarchiver = unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&error];
NSMutableArray *loadedCredentialIdentities = (NSMutableArray *)[unarchiver decodeObjectForKey:kStoredCredentialIdentities];
[unarchiver finishDecoding];