I just want to make sure this is possible. Let's say I build three different views in interface builder, and they all have their own unique buttons/layout. Is it pos开发者_如何转开发sible to load, one view based on what the user says in the settings. If so where should this been done. Any examples would be appreciated.
Sure --
int userPref = [[NSUserDefaults standardUserDefaults] integerForKey:@"theme_pref"];
UIViewController *controller;
if (userPref == kOption1)
controller = [[UIViewController alloc] initWithNibName:@"controller1" bundle:nil];
else if (userPref == kOption2)
controller = [[UIViewController alloc] initWithNibName:@"controller2" bundle:nil];
Replace UIViewController with the name of your class. Also, that's just one way of retrieving the preference -- use whatever you want.
精彩评论