title: iOS - How to implement self created delegate in ios6
body: <p>i have created a delegate for my project the code of my main view is </p>
  
  <p><strong>VedantViewController.h</strong></p>
  
  <pre><code>@protocol VedantDelegate;
  
  @interface VedantViewController : UIViewController
  {    
      id &lt;VedantDelegate&gt; delegate;   
  }
  
  //some other outlets
  @property(nonatomic, assign) id &lt;VedantDelegate&gt; delegate;
  
  @protocol VedantDelegate &lt;NSObject&gt;
  
  - (void)display:(NSString *)JSONResponse;
  
  @end
  </code></pre>
  
  <p><strong>VedantViewController.m</strong></p>
  
  <pre><code>@synthesize delegate;
  
  [delegate display:jsonResponse];
  </code></pre>
  
  <p><strong>SecondViewController.h</strong></p>
  
  <pre><code>@interface SecondViewController : UIViewController&lt;VedantDelegate&gt;
  
  - (void)display:(NSString *)JSONResponse;
  </code></pre>
  
  <p><strong>SecondViewController.m</strong></p>
  
  <pre><code>- (void)display:(NSString *)string
  {
  
  }
  </code></pre>
  
  <p>but this code is not working properly
  when i debug the code using breakpoints the code reaches the </p>
  
  <pre><code>[delegate display:abc];
  </code></pre>
  
  <p>but it does not calls display function in <strong>SecondViewController.m</strong> file</p>
  
  <p>i think my code is right but some mistake that i can't recognize </p>
  
  <p>let me explain you the flow of my project this could be the problem</p>
  
  <p>by default the VedantViewController view is launched 
  after that when the show button is click it calls the SecondViewController view in the view these is list button that calls the function in VedantViewController this function then calls the delegate method that is [delegate display:jsonResponse];</p>
  
  <p>Thanks in Advance,
  Arun.</p>