title: refresh data after entering a foreground
body: <p>After changing the default settings, I would like to refresh data of myViewController when I enter the foreground in AppDelegate. What I do is</p>
  
  <p>AppDelegate.m</p>
  
  <pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)application
  {
      [window addSubview:[navigationController view]];
      NSLog(@"APPLICATION DID FINISH LAUNCHING");
      // listen for changes to our preferences when the Settings app does so,
      // when we are resumed from the backround, this will give us a chance to update our UI
      //
      [[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(defaultsChanged:)
                                             name:NSUserDefaultsDidChangeNotification
                                           object:nil];
  }
  
  - (void)applicationWillEnterForeground:(UIApplication *)application
  {
      /*
       Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
       */
      NSLog(@"APPLICATION WILL ENTER BACKGROUND");
      [myViewController viewDidLoad];
  }
  </code></pre>
  
  <p>myViewController.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
      NSLog(@"VIEW DID LOAD IN MY VIEW CONTROLLER");
      // watch when the app has finished launching so we can update our preference settings and apply them to the UI
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSettings:) 
                                          name:UIApplicationDidFinishLaunchingNotification object:nil];
  }
  
  - (void)updateSettings:(NSNotification *)notif
  {
      myLabel.text = @"data has just been modified";
  }
  </code></pre>
  
  <p>However, there is nothing changed at all.</p>