title: NSNotificationCenter and passing data between view controllers and my class/ Am I on the wrong way?
body: <p>For test purposes I've created an application with <code>UITabBar</code>, 3 view controllers and my class DataAnalyzer (till now it analyses nothing:)).</p>
  
  <p>TestAppDelegate.m</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
     //..... 
      NSArray *allControllers = [self.tabBarController viewControllers];
  
      NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
      for (UIVideoEditorController * viewController in allControllers) {
          [center addObserver:viewController selector:@selector(useUpdatedData:) name:@"dataUpdated" object:nil];
          NSLog(@"%@", [viewController description]);
      }    
  
      DataAnalizer *dataAnalizer = [[DataAnalizer alloc] init];
      [center addObserver:dataAnalizer selector:@selector(useUpdatedData:) name:@"dataUpdated" object:nil];
      // dataAnalizer can't be released here? Where should it be done?
      return YES;
  }
  </code></pre>
  
  <p>in 2-nd, 3-rd view controllers and DataAnalyzer class I added the same method</p>
  
  <pre><code>- (void) useUpdatedData:(NSNotification *)note {
      NSLog(@"Notificatio received in *** view controller");
  
      //do something with [note object] like show it on a label or store it to instance variable
  } 
  </code></pre>
  
  <p>in 1-st view controller I added text field to send a string as notification</p>
  
  <pre><code>- (void)textFieldDidEndEditing:(UITextField *)textField {
  
      NSLog(@"First viewController textFieldDidEndEditing: value is %@ ", textField.text);
      NSNotificationCenter *note = [NSNotificationCenter defaultCenter];
      [note postNotificationName:@"dataUpdated" object:textField.text];
  
  
  }
  </code></pre>
  
  <p>When I send a string, I see <code>NSLog</code> message in console that notification is received, but can do nothing with the string like showing it on a label. I understand that it's because a view controllers load first time and they were not initiated. But why I'm getting <code>NSLog</code> message in console? Can I send a string to dataAnalizer class, do something there and then get a result to second and third view controllers?
  Thank you in advance for your answers, because it seems all above is a wrong approach.</p>