title: Problem in passing data values between classes through delegation object c
body: <p>I just want to transfer data from MyCoolViewController to firstViewController. </p>
  
  <p>I have a problem with trasferring data from MyCoolViewController class to firstViewController. here is my code</p>
  
  <pre><code>MyCoolViewController.h// a class where data send from
  
  @protocol MyCoolViewDelegate;
  
  @interface MyCoolViewController : UIViewController  {
  
  
  id &lt;MyCoolViewDelegate&gt; delegate;//
  }
  @property (nonatomic, assign) id delegate;//
  
  
  @end
  @protocol MyCoolViewDelegate &lt;NSObject&gt;//
  
  -(void)sendAStringToAnotherView:(NSString*)string;
  @end
  
  MyCoolViewController.m
  
  -(void)viewDidLoad{
  </code></pre>
  
  <p>label.text=townName;</p>
  
  <pre><code>[delegate sendAStringToAnotherView:townName];//problem is here
  }
  
  
  
  
  firstViewController.m  //a class where data sent
  -(void)viewDidLoad{
  
  MyCoolViewController *myViewControllerPointer=[[MyCoolViewController alloc] init];
  myViewControllerPointer.delegate = self;//
  }
  
  -(void)sendAStringToAnotherView:(NSString*)string
  {
  //displays the string as console output
  NSLog(@"plzzzzzz show data%@",string);
  }
  </code></pre>
  
  <p>it nothing. Please help</p>