22 entries:(NSArray *)entries
23 selections:(NSArray *)selections
24{
25 self = [super initWithStyle:UITableViewStyleGrouped];
26 if (self)
27 {
28 _params = [params retain];
29 _entries = [entries retain];
30 _selections = [selections retain];
31
32
33 _cur_selections = [[NSMutableArray alloc] initWithCapacity:[_entries count]];
34 for (int i = 0; i < [entries count]; ++i)
35 {
36 NSString *entry = [entries objectAtIndex:i];
37 if ([_params hasValueForKeyPath:entry])
38 {
40 indexForValue:[NSNumber numberWithInt:[_params intForKeyPath:entry]]];
41 [_cur_selections addObject:[NSNumber numberWithInt:(idx != NSNotFound ? idx : 0)]];
42 }
43 else
44 [_cur_selections addObject:[NSNumber numberWithInt:0]];
45 }
46 }
47 return self;
48}