@@ 450,6 450,7 @@ typedef enum : NSUInteger {
[coder encodeBool:self.isRandomMode forKey:@"isRandomMode"];
[coder encodeObject:@(self.repeatMode) forKey:@"repeatMode"];
[coder encodeObject:@(self.volume) forKey:@"volume"];
+ [coder encodeObject:self.outlineView.sortDescriptors forKey:@"sortDescriptors"];
}
- (void)restoreStateWithCoder:(NSCoder *)coder {
@@ 459,6 460,14 @@ typedef enum : NSUInteger {
self.viewMode = _viewMode;
float v = [(NSNumber*)[coder decodeObjectOfClass:[NSNumber class] forKey:@"volume"] floatValue];
[self setVolume:v];
+ if ([coder containsValueForKey:@"sortDescriptors"]) {
+ // TODO: Fix this, don't know why this is always nil (but the above condition is true)
+ // Maybe have to do with the buggy state restoration on Mac
+ NSArray *x = [coder decodeObjectForKey:@"sortDescriptors"];
+ if (x != nil) {
+ self.outlineView.sortDescriptors = x;
+ }
+ }
}
#pragma mark - Outline View