Correction for coding... add base class for converter.

This commit is contained in:
Gregory John Casamento 2019-10-02 00:57:17 -04:00
parent 4c51378c0c
commit b2f4495a75
2 changed files with 20 additions and 2 deletions

View file

@ -34,6 +34,12 @@ extern "C" {
#if OS_API_VERSION(MAC_OS_X_VERSION_10_12, GS_API_LATEST)
@interface NSUnitConverter : NSObject
- (double)baseUnitValueFromValue:(double)value;
- (double)valueFromBaseUnitValue:(double)baseUnitValue;
@end
@interface NSUnit : NSObject <NSCopying, NSCoding>
{
NSString *_symbol;

View file

@ -24,9 +24,21 @@
*/
#include <Foundation/NSUnit.h>
#include <Foundation/NSArchiver.h>
@implementation NSUnitConverter
- (double)baseUnitValueFromValue:(double)value
{
return 0.0;
}
- (double)valueFromBaseUnitValue:(double)baseUnitValue
{
return 0.0;
}
@end
@implementation NSUnit
+ (instancetype)new
{
@ -57,7 +69,7 @@
{
if([coder allowsKeyedCoding])
{
_symbol = [coder decodeObjectRorKey: @"symbol"];
_symbol = [coder decodeObjectForKey: @"symbol"];
}
else
{