title: Can access NSUserDefualts but code not responding to Key Value
body: <p>(xCode 4.2.1) I have a Utility app with a couple of custom settings in the flipside view for changing the appearance of a UIImageView in the Main View Controller. That part I have working perfectly. I can print my defaults with NSLog, and all of the actions seem to be working without fail. </p>
  
  <p>I'm only working with one key, and that is: "skinPreference" which I'm using to simply switch a background image in the MainViewController.</p>
  
  <p>My problem is an if statement in my Flipside ViewDidLoad function. Even though I can retrieve the correct value from "skinPreference", it does not respond to the first half of this if statement, and always executes the "else" portion. I'm displaying a green dot next to the button which the user has set as the default skin preference. It seems to always be on Mahogany when you launch the app, no matter what I do, but I can see the correct value in the log.</p>
  
  <p>Here is the if statement causing the problems. I need it to fetch the valur of "skinPreference," which it does, according to NSLog, and set the images accordingly. It's not working. </p>
  
  <p>Flipside.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
  
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
      NSString *skinPref = [defaults valueForKey:@"skinPreference"];
  
      if (skinPref == @"Classic") {
          NSLog(skinPref, @"@%");
          imgClassicDot.image = [UIImage imageNamed:skinPref];
          imgMahoganyDot.image = [UIImage imageNamed:skinPref];
      } else {
          NSLog(skinPref, @"@%");
          imgClassicDot.image = [UIImage imageNamed:@"dot"];
          imgMahoganyDot.image = [UIImage imageNamed:@"dotGreen"];
      }
  
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  </code></pre>
  
  <p>In my App delagate, I have the following code, which makes sure the key has a value if it's the very first time the app has loaded: (and the NSLog returns the correct setting every time)</p>
  
  <p>AppDelegate.m (in didFinishLaunchingWithOptions)</p>
  
  <pre><code> NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
          NSString *pref = [defaults valueForKey:@"skinPreference"];
          if (pref == nil) {
              NSLog(@"%@ DEFAULTS = %@", [self class], [defaults persistentDomainForName:[[NSBundle mainBundle] bundleIdentifier]]);
  
              [defaults setValue:@"Classic" forKey:@"skinPreference"]; 
              [defaults synchronize];
          }
  </code></pre>
  
  <p>In my Flipside.h I have a couple custom methods I trigger from 2 buttons. (SkinDidChangeToClassic, and skinDidChangeToMahogany)</p>
  
  <pre><code>@protocol FlipsideViewControllerDelegate
  - (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller;
  - (void)skinDidChangeToClassic;
  - (void)skinDidChangeToMahogany;
  @end
  </code></pre>
  
  <p>And here are those 2 methods in my MainViewController.m</p>
  
  <pre><code>- (void)skinDidChangeToClassic {
  
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
      [defaults setValue:@"Classic" forKey:@"skinPreference"];
      NSString *skinPref = [defaults valueForKey:@"skinPreference"];
      [defaults synchronize];
       skin.image = [UIImage imageNamed:skinPref];
  
  }
  
  - (void)skinDidChangeToMahogany {
  
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
      [defaults setValue:@"Mahogany" forKey:@"skinPreference"];
      NSString *skinPref = [defaults valueForKey:@"skinPreference"];
      [defaults synchronize];
      skin.image = [UIImage imageNamed:skinPref];
  }
  </code></pre>
  
  <p>And finally, here is where I fire the methods from the flipside.m</p>
  
  <pre><code>- (IBAction)setSkinClassic:(id)sender 
  {
      imgClassicDot.image = [UIImage imageNamed:@"dotGreen"];
      imgMahoganyDot.image = [UIImage imageNamed:@"dot"];
      [self.delegate skinDidChangeToClassic];
  }
  
  - (IBAction)setSkinMahogony:(id)sender 
  {
      imgClassicDot.image = [UIImage imageNamed:@"dot"];
      imgMahoganyDot.image = [UIImage imageNamed:@"dotGreen"];
      [self.delegate skinDidChangeToMahogany];
  }
  </code></pre>
  
  <p>I'm not a guru, so any ideas would be super appreciated.</p>