Changing Views From Inside App
I have a one View Controller Called ThemeViewController with three nibs, all of which are a different theme.
I want to ch开发者_开发技巧ange the nib simply by hitting a button from within the app. I placed this method from within the ThemeViewController class.
- (IBAction)switchTheme {
self = [[ThemeViewController alloc] initWithNibName:@"theme_1" bundle:nil];
}
Any help or suggestions? Thanks
Use this instead:
[[NSBundle mainBundle] loadNibNamed:@"yourNibName" owner:self options:nil];
精彩评论