iPhone development
RSS icon Email icon Home icon
  • Another way to create Settings views

    Posted on May 4th, 2009 Kare No comments

    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:

    1. - (void)constructTableGroups
    2. {
    3. NSMutableArray *cells = [NSMutableArray array];
    4. IFTextCellController *textCell = [[[IFTextCellController alloc] initWithLabel:@"Text" andPlaceholder:@"Placeholder" atKey:@"sampleText" inModel:model] autorelease];
    5. [cells addObject:textCell];
    6. IFSwitchCellController *switchCell = [[[IFSwitchCellController alloc] initWithLabel:@"Switch" atKey:@”sampleSwitch” inModel:model] autorelease];
    7. [cells addObject:switchCell];
    8. tableGroups = [[NSArray arrayWithObject:cells] retain];
    9. }

    Check it out at http://furbo.org/2009/04/30/matt-gallagher-deserves-a-medal/ .

    Leave a reply