-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDevice.m
57 lines (45 loc) · 1.9 KB
/
Device.m
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// Device.m
// data_m
//
// Created by Mike Fluff on 21.04.11.
// Copyright (c) 2011 Altell ltd. All rights reserved.
//
#import "Device.h"
#import "Interface.h"
#import "Tests.h"
@implementation Device
@dynamic manageip;
@dynamic id;
@dynamic links;
@dynamic type;
@dynamic isServer;
@dynamic login;
@dynamic password;
@dynamic interface;
@dynamic tests;
- (void)addInterfaceObject:(Interface *)value {
NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1];
[self willChangeValueForKey:@"interface" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"interface"] addObject:value];
[self didChangeValueForKey:@"interface" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[changedObjects release];
}
- (void)removeInterfaceObject:(Interface *)value {
NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1];
[self willChangeValueForKey:@"interface" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"interface"] removeObject:value];
[self didChangeValueForKey:@"interface" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects];
[changedObjects release];
}
- (void)addInterface:(NSSet *)value {
[self willChangeValueForKey:@"interface" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
[[self primitiveValueForKey:@"interface"] unionSet:value];
[self didChangeValueForKey:@"interface" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
}
- (void)removeInterface:(NSSet *)value {
[self willChangeValueForKey:@"interface" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
[[self primitiveValueForKey:@"interface"] minusSet:value];
[self didChangeValueForKey:@"interface" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
}
@end