-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSensorData.m
More file actions
40 lines (34 loc) · 1.01 KB
/
SensorData.m
File metadata and controls
40 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// SensorData.m
// Test
//
// Created by vincent on 11/6/15.
// Copyright © 2015 vincent. All rights reserved.
//
#import "SensorData.h"
@implementation SensorData
-(DataType)itemTypeRaw {
return (DataType)[[self type] intValue];
}
-(void)setDataTypeRaw:(DataType)type {
[self setType:[NSNumber numberWithInt:type]];
}
+(NSSet *)keyPathsForValuesAffectingDataTypeRaw {
return [NSSet setWithObject:@"type"];
}
- (void)copyValue:(Data *)sensorData {
self.value = [NSNumber numberWithInteger:sensorData.value];
self.startDate = sensorData.startDate;
self.endDate = sensorData.endDate;
self.type = [NSNumber numberWithInt:sensorData.type];
}
- (Data *)getDataFromSensorData{
Data *instance = [[Data alloc]init];
instance.value = [self.value integerValue];
instance.startDate = self.startDate;
instance.endDate = self.endDate;
instance.type = (DataType)[self.type intValue];
return instance;
}
// Insert code here to add functionality to your managed object subclass
@end