Hi
I am getting below error while unarchiving my objective-c custom class.
Error Domain=NSCocoaErrorDomain Code=4864 ""* -[NSKeyedUnarchiver initForReadingFromData:error:throwLegacyExceptions:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver?"" UserInfo={NSDebugDescription=* -[NSKeyedUnarchiver initForReadingFromData:error:throwLegacyExceptions:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver?}"
I am using the method [NSKeyedUnarchiver unarchivedObjectOfClass:[BBUserInfo class] fromData:data error:&error] to un archive the data.
My custom object is confirm to NSSecureCoding and implemented protocol method as below
(BOOL)supportsSecureCoding {
return YES;
}
Also this error doesn't reproduce for me, Its happening in the App Store released version. I am able to figure this error only through the logs.
I'm a bit of a confused especially in regards to NSKeyedArchiver but where am I supposed to send -finishEncoding to the NSKeyedArchiver. Since finishEncoding is a instance method were as I am using class method to unarchive.
Can some one help me on this?