-
Notifications
You must be signed in to change notification settings - Fork 0
/
SelData.m
executable file
·104 lines (80 loc) · 1.7 KB
/
SelData.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//
// SelData.m
// DynamicSelections
//
// Created by Peter Appel on 03/07/2008.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "SelData.h"
@implementation SelData
- (id)init
{
if (self = [super init])
{
[self setNoOfPoints:0];
[self setCountOfSel:0];
[self setSel:[NSArray array]];
}
return self;
}
- (int)countOfSel
{
return countOfSel;
}
- (void)setCountOfSel:(int)aCountOfSel
{
countOfSel = aCountOfSel;
}
- (int)noOfPoints
{
return noOfPoints;
}
- (void)setNoOfPoints:(int)aNoOfPoints
{
noOfPoints = aNoOfPoints;
}
- (NSArray *)sel {return sel;}
-(void)setSel:(NSArray *)aSel
{
if (sel != aSel)
{
[sel autorelease];
sel = [[NSArray alloc] initWithArray: aSel];
}
}
/*
- (NSIndexSet *)sel {return sel;}
-(void)setSel:(NSIndexSet *)aSel
{
if (sel != aSel)
{
[sel autorelease];
sel = [[NSIndexSet alloc] initWithIndexSet: aSel];
}
}
*/
- (void) dealloc
{
// [name release];
[super dealloc];
}
- (id)initWithCoder:(NSCoder *)coder
{
self=[super init];
// NSData *idData = [coder decodeObjectForKey:@"sel"];
// NSIndexSet *newSel = [NSUnarchiver unarchiveObjectWithData:idData];
// [self setSel:newSel];
[self setSel:[coder decodeObjectForKey:@"sel"]];
[self setCountOfSel:[coder decodeIntForKey:@"countOfSel"]];
[self setNoOfPoints:[coder decodeIntForKey:@"noOfPoints"]];
return self;
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
// NSData *idData = [NSArchiver archivedDataWithRootObject:sel];
// [encoder encodeObject:idData forKey:@"sel"];
[encoder encodeObject:[self sel] forKey:@"sel"];
[encoder encodeInt:[self countOfSel] forKey:@"countOfSel"];
[encoder encodeInt:[self noOfPoints] forKey:@"noOfPoints"];
}
@end