Improve NSSecureCoding support.

This commit is contained in:
Damiano Galassi committed 2016-11-09 18:00:22 +01:00
1 parent c3042aff75
commit bd38d02c2a
6 files changed
+28 -4

No files matched your search

+7 -1
View File
@@ -304,6 +304,11 @@
#pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding
{
return YES;
}
- (void)encodeWithCoder:(NSCoder *)coder
{
[super encodeWithCoder:coder];
@@ -316,7 +321,8 @@
self = [super initWithCoder:decoder];
if (self) {
_chapters = [decoder decodeObjectOfClass:[NSMutableArray class] forKey:@"chapters"];
_chapters = [decoder decodeObjectOfClasses:[NSSet setWithObjects:[NSMutableArray class], [MP42TextSample class], nil]
forKey:@"chapters"];
}
return self;