forked from charlieroberts/midiStroke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EndNote.m
36 lines (29 loc) · 1.09 KB
/
EndNote.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
#import "EndNote.h"
@implementation EndNote
- (id) init {
if (self = [super init]) {
NSArray * keys = [NSArray arrayWithObjects: @"keystroke", @"apple", @"shift", @"option", @"control",nil];
NSArray * values = [NSArray arrayWithObjects: @"Z", @"TRUE", @"FALSE", @"FALSE", @"FALSE",nil];
properties = [[NSMutableDictionary alloc] initWithObjects: values forKeys: keys];
}
return self;
}
- (void) encodeWithCoder: (NSCoder *)coder { [coder encodeObject: properties forKey:@"properties"]; } // must have for every array
- (id) initWithCoder: (NSCoder *) coder { // initializes from file
if (self = [super init])
{
[self setProperties: [coder decodeObjectForKey:@"properties"]];
}
return self;
}
- (void) dealloc { [properties release]; [super dealloc]; }
- (NSMutableDictionary *) properties {
return properties;
}
- (void) setProperties: (NSDictionary *)newProperties {
if (properties != newProperties) {
[properties autorelease];
properties = [[NSMutableDictionary alloc] initWithDictionary: newProperties];
}
}
@end