mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Add encoding
This commit is contained in:
parent
2208132e41
commit
c7a3c798a9
1 changed files with 14 additions and 5 deletions
|
@ -22,6 +22,7 @@
|
|||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArchiver.h>
|
||||
#import "AppKit/NSSplitViewItem.h"
|
||||
|
||||
@implementation NSSplitViewItem
|
||||
|
@ -148,16 +149,24 @@
|
|||
// NSCoding
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super init];
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
if ([coder containsValueForKey: @"NSSplitViewItemViewController"])
|
||||
{
|
||||
_viewController = [coder decodeObjectForKey: @"NSSplitViewItemViewController"];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
[coder encodeObject: _viewController
|
||||
forKey: @"NSSplitViewItemViewController"];
|
||||
}
|
||||
}
|
||||
|
||||
// NSCopying
|
||||
- (id) copyWithZone: (NSZone *)z
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue