Closed n1mda closed 8 years ago
// AppDelegate.m
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"settings.language": @0, }];
// SettingsTableViewController.m
[self addSection:[BOTableViewSection sectionWithHeaderTitle:DPLocalizedString(@"settings.navbar.title", nil) handler:^(BOTableViewSection *section) { [section addCell:[BOChoiceTableViewCell cellWithTitle:DPLocalizedString(@"settings.table.language", nil) key:@"settings.language" handler:^(BOChoiceTableViewCell *cell) { cell.options = @[@"English", @"Swedish", @"Russian", @"Uzbek"]; cell.destinationViewController = [LanguageSettingsViewController new]; }]]; }]];
// LanguageSettingsViewController.m
- (void)setup { self.title = DPLocalizedString(@"settings.table.language", nil); [self addSection:[BOTableViewSection sectionWithHeaderTitle:DPLocalizedString(@"settings.table.language", nil) handler:^(BOTableViewSection *section) { [section addCell:[BOOptionTableViewCell cellWithTitle:@"English" key:@"settings.language" handler:nil]]; [section addCell:[BOOptionTableViewCell cellWithTitle:@"Swedish" key:@"settings.language" handler:nil]]; [section addCell:[BOOptionTableViewCell cellWithTitle:@"Russian" key:@"settings.language" handler:nil]]; [section addCell:[BOOptionTableViewCell cellWithTitle:@"Uzbek" key:@"settings.language" handler:nil]]; }]]; }
It displays LanguageSettingsViewController but nothing happens when I select any of the options.
Keys can't have dot notation in them... Worked fine by using language_settings instead of settings.language
language_settings
settings.language
Glad you found out the answer! Sorry for not replying, I'm not home this weekend.
// AppDelegate.m
// SettingsTableViewController.m
// LanguageSettingsViewController.m
It displays LanguageSettingsViewController but nothing happens when I select any of the options.