I need to load different background images into the first ViewController UIImageView, called the background, depending on what settings are used to switch the toolbar in the Settings Panel.
In -viewWillAppear in ViewController.m
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; id toggleSwitchValue = [defaults objectForKey:@"PSToggleSwitchSpecifier"]; BOOL boolToggle = [toggleSwitchValue boolValue]; // setting custom back for viewController if (boolToggle == YES) { [self.backGround setImage:[UIImage imageNamed:@"1.png"]]; NSLog(@"YES"); } else if (boolToggle == NO) { [self.backGround setImage:[UIImage imageNamed:@"2.png"]]; NSLog(@"NO"); }
I have no warnings, but I cannot set the image that will be used.
Any ideas for a solution?
source share