I’ve been breaking my head for the past two days searching and trying some of my own solutions. I placed a UIBarButtonItem through IB with an image in the top bar to act as a mute/unmute button . Everything works except the image doesn’t change. I used the following code and it compiles but no change
if( mute == YES ) {
UIImage *unmuteImage = [UIImage imageNamed:@"audio-on.png"];
[self.muteButton setImage:unmuteImage];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"muteKey"];
}
else {
UIImage *muteImage = [UIImage imageNamed:@"audio-off.png"];
[self.muteButton setImage:muteImage];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"muteKey"];
}
I finally figured it out…only took a couple of days but I’ve been too busy to post up a solution. We’ll I finally got time and am happy to post my solution. I had a hunch that this would’nt work unless it was done 100% programmatically, and I was right. Here’s the final solution to my problem:
the good news is I finally finished my app and submitted it to the app store. Hopefully everything will go smooth and am looking forward to it!