Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
805 | - | 1 | // |
2 | // PSTitleValueSpecifierCell.m |
||
3 | // InAppSettingsTestApp |
||
4 | // |
||
5 | // Created by David Keegan on 11/21/09. |
||
6 | // Copyright 2009 InScopeApps{+}. All rights reserved. |
||
7 | // |
||
8 | |||
9 | #import "InAppSettingsPSTitleValueSpecifierCell.h" |
||
10 | #import "InAppSettingsConstants.h" |
||
11 | |||
12 | @implementation InAppSettingsPSTitleValueSpecifierCell |
||
13 | |||
14 | - (NSString *)getValueTitle{ |
||
15 | NSArray *titles = [self.setting valueForKey:InAppSettingsSpecifierTitles]; |
||
16 | NSArray *values = [self.setting valueForKey:InAppSettingsSpecifierValues]; |
||
17 | if(titles || values){ |
||
18 | if(([titles count] == 0) || ([values count] == 0) || ([titles count] != [values count])){ |
||
19 | return nil; |
||
20 | } |
||
21 | NSInteger valueIndex = [values indexOfObject:[self.setting getValue]]; |
||
22 | if((valueIndex >= 0) && (valueIndex < (NSInteger)[titles count])){ |
||
23 | return [titles objectAtIndex:valueIndex]; |
||
24 | } |
||
25 | |||
26 | return nil; |
||
27 | } |
||
28 | |||
29 | return [self.setting getValue]; |
||
30 | } |
||
31 | |||
32 | - (void)setUIValues{ |
||
33 | [super setUIValues]; |
||
34 | |||
35 | [self setTitle]; |
||
36 | |||
37 | if([self.setting valueForKey:InAppSettingsSpecifierInAppURL]){ |
||
38 | [self setDisclosure:YES]; |
||
39 | self.canSelectCell = YES; |
||
40 | } |
||
41 | |||
42 | [self setDetail:[self getValueTitle]]; |
||
43 | } |
||
44 | |||
45 | @end |