-
Notifications
You must be signed in to change notification settings - Fork 0
/
nnDVStringUIText.m
59 lines (45 loc) · 1.02 KB
/
nnDVStringUIText.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
//
// nnDVStringUIText.m
//
// Created by Brice Tebbs on 1/29/11.
// Copyright 2011 northNitch Studios, Inc. All rights reserved.
//
#import "nnDVStringUIText.h"
@implementation nnDVStringUIText
@synthesize dvInfo;
- (void)dealloc {
[dvInfo release];
[super dealloc];
}
-(BOOL)isChanged
{
return [self.dvInfo getString] != self.text;
}
-(void)textChanged
{
[self.dvInfo handleChangeString: self.text];
}
-(void)awakeFromNib
{
[super awakeFromNib];
[self addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];
}
-(void)populate
{
[self setText: [self.dvInfo getString]];
}
-(void)save
{
if ([self isChanged])
{
[self.dvInfo storeString: self.text];
}
}
-(void)setupDvInfo: (NSObject*) tag handler: (id <nnDVStoreProtocol>) handler delegate: (id <nnDVChangedProtocol>) delegate
{
nnDVString *s = [ [nnDVString alloc] init: tag withHandler: handler];
self.dvInfo = s;
self.dvInfo.dvChangedDelegate = delegate;
[s release];
}
@end