-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathABSourcesSCObjectSelectionCell.m
53 lines (40 loc) · 1.29 KB
/
ABSourcesSCObjectSelectionCell.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
//
// ABSourcesSCObjectSelectionCell.m
// PsyTrack Clinician Tools
//
// Created by Daniel Boice on 3/17/12.
// Copyright (c) 2012 PsycheWeb LLC. All rights reserved.
//
#import "ABSourcesSCObjectSelectionCell.h"
#import "MySource.h"
#import "PTTAppDelegate.h"
@implementation ABSourcesSCObjectSelectionCell
- (void) performInitialization
{
[super performInitialization];
self.allowAddingItems = NO;
self.allowDeletingItems = NO;
self.allowEditDetailView = NO;
self.allowMovingItems = NO;
self.allowMultipleSelection = NO;
self.allowNoSelection = NO;
}
- (void) loadBoundValueIntoControl
{
NSString *selectedName = [NSString string];
for (int i = 0; i < self.items.count; i++)
{
NSNumber *p = (NSNumber *)[NSNumber numberWithInt:i];
MySource *mySource = [self.items objectAtIndex:i];
if ([self.selectedItemIndex isEqualToNumber:p])
{
NSMutableSet *selectedItemsIndexesSet = (NSMutableSet *)self.selectedItemsIndexes;
[selectedItemsIndexesSet addObject:p];
selectedName = [NSString stringWithFormat:@"%@",mySource.name];
[[NSUserDefaults standardUserDefaults] setValue:p forKey:kPTTAddressBookSourceIdentifier];
break;
}
}
self.label.text = selectedName;
}
@end