Hi All,
I have set up the settings.bundle and an Options View in my app that mirrors the settings. All of this works and there doesn't seem to be any problem with it. Options opens as a modal view, the user then changes a switch and clicks the done button that closes the Options view and returns to the main view, which has a Scrollview on it. Based on the switch setting, I want to display one of two images, but it only shows the negative result image.
Two questions:
1. The if/else is in the main view ViewDidLoad. Is this the right place to update the scrollview?
2. Should it be dealt with when the user clicks the Done button, and how?
I have checked the value returned from the NSUserdefaults, but the result doesn't seem to be recognised or acted upon.
I get no errors anywhere in the app.
I have set up the settings.bundle and an Options View in my app that mirrors the settings. All of this works and there doesn't seem to be any problem with it. Options opens as a modal view, the user then changes a switch and clicks the done button that closes the Options view and returns to the main view, which has a Scrollview on it. Based on the switch setting, I want to display one of two images, but it only shows the negative result image.
Two questions:
1. The if/else is in the main view ViewDidLoad. Is this the right place to update the scrollview?
2. Should it be dealt with when the user clicks the Done button, and how?
I have checked the value returned from the NSUserdefaults, but the result doesn't seem to be recognised or acted upon.
Code:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *Zones = [defaults objectForKey:@"zones"];
UIImageView *tempImageView;
if (Zones == @"Enabled") {
tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"zones.jpg"]];
} else {
tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nozones.jpg"]];
}
self.imageView = tempImageView;
I get no errors anywhere in the app.