diff options
Diffstat (limited to 'macosx/HBDistributedArray.m')
-rw-r--r-- | macosx/HBDistributedArray.m | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/macosx/HBDistributedArray.m b/macosx/HBDistributedArray.m index 266382166..f92abfdf5 100644 --- a/macosx/HBDistributedArray.m +++ b/macosx/HBDistributedArray.m @@ -60,7 +60,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk"; @property (nonatomic, readwrite) NSTimeInterval modifiedTime; @property (nonatomic, readonly) NSSet *objectClasses; -@property (nonatomic, readonly) BOOL requiresSecureCoding; @property (nonatomic, readonly) sem_t *mutex; @property (nonatomic, readwrite) uint32_t mutexCount; @@ -78,12 +77,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk"; _array = [[NSMutableArray alloc] init]; _objectClasses = [NSSet setWithObjects:[NSMutableArray class], objectClass, nil]; - // Enable secure coding only on 10.9 and later - if ([NSURL instancesRespondToSelector:@selector(fileSystemRepresentation)]) - { - _requiresSecureCoding = YES; - } - NSString *identifier = [[NSBundle mainBundle] bundleIdentifier]; NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:identifier]; const char *name = [NSString stringWithFormat:@"%@/%@", identifier, _fileURL.lastPathComponent.stringByDeletingPathExtension].UTF8String; @@ -204,18 +197,11 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk"; NSMutableArray *jobsArray = nil; @try { - if (self.requiresSecureCoding) - { - NSData *queue = [NSData dataWithContentsOfURL:self.fileURL]; - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue]; - unarchiver.requiresSecureCoding = YES; - jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey]; - [unarchiver finishDecoding]; - } - else - { - jobsArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path]; - } + NSData *queue = [NSData dataWithContentsOfURL:self.fileURL]; + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue]; + unarchiver.requiresSecureCoding = YES; + jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey]; + [unarchiver finishDecoding]; } @catch (NSException *exception) { |