title: Xcode - update ViewController label text from different view
body: <p>I have two view Controllers in my project <code>ViewController</code>, <code>SettingsView</code>. Here I am trying to update the <code>ViewController's</code> label, when i click on the <code>SettingsView's</code> back button. <code>NSLog</code> is working fine, but the label is not updating...
  Please help me....  </p>
  
  <p><strong>SettingsView.m</strong></p>
  
  <pre><code>-(IBAction)backToMain:(id) sender {
  
    //calling update function from ViewController
      ViewController * vc = [[ViewController alloc]init];
      [vc updateLabel];
      [vc release];
  
    //close the SettingsView 
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p><strong>ViewController.m</strong></p>
  
  <pre><code>- (void)updateLabel
  {
      NSLog(@"Iam inside updateLabel");
     self.myLabel.text = @"test";
  }
  </code></pre>
  
  <p>Could you please tell me whats wrong with my code? Thank you!</p>