Another way to create Settings views

04 May 2009  iphone-development

Craig Hockenberry has also created an API for Settings views. But unlike mySettings his API creates the views from code instead of plists. Like this:

- (void)constructTableGroups
NSMutableArray *cells = [NSMutableArray array];
IFTextCellController *textCell = [[[IFTextCellController alloc] initWithLabel:@"Text" andPlaceholder:@"Placeholder" atKey:@"sampleText" inModel:model] autorelease];
[cells addObject:textCell];
IFSwitchCellController *switchCell = [[[IFSwitchCellController alloc] initWithLabel:@"Switch" atKey:@”sampleSwitch” inModel:model] autorelease];
[cells addObject:switchCell];
tableGroups = [[NSArray arrayWithObject:cells] retain];

Check it out at .