diff options
Diffstat (limited to 'macosx/HBCodingUtilities.m')
-rw-r--r-- | macosx/HBCodingUtilities.m | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/macosx/HBCodingUtilities.m b/macosx/HBCodingUtilities.m deleted file mode 100644 index 80e245a7b..000000000 --- a/macosx/HBCodingUtilities.m +++ /dev/null @@ -1,58 +0,0 @@ -// -// HBCodingUtilities.m -// HandBrake -// -// Created by Damiano Galassi on 22/04/15. -// -// - -#import "HBCodingUtilities.h" - -static BOOL useSecureCoding; - -@implementation HBCodingUtilities - -+ (void)initialize -{ - static BOOL initialized = NO; - - if (!initialized && self == [HBCodingUtilities class]) - { - useSecureCoding = [NSCoder instancesRespondToSelector:@selector(decodeObjectOfClass:forKey:)] ? YES : NO; - } -} - -+ (id)decodeObjectOfClass:(Class)aClass forKey:(NSString *)key decoder:(NSCoder *)decoder -{ - if (useSecureCoding) - { - return [decoder decodeObjectOfClass:aClass forKey:key]; - } - else - { - id obj = [decoder decodeObjectForKey:key]; - if (![obj isKindOfClass:aClass]) - { - return nil; - } - else - { - return obj; - } - } -} - -+ (id)decodeObjectOfClasses:(NSSet *)classes forKey:(NSString *)key decoder:(NSCoder *)decoder -{ - if (useSecureCoding) - { - return [decoder decodeObjectOfClasses:classes forKey:key]; - } - else - { - id obj = [decoder decodeObjectForKey:key]; - return obj; - } -} - -@end |