title: Custom delegate is returning nil value
body: <p>I am creating a protocol like this.</p>
  
  <pre><code>   @protocol parsingComplete &lt;NSObject&gt;
     @optional
       -(void) updateUI:(NSMutableDictionary*)foodList;
     @end
  
     @interface foodParser:NSObject&lt;NSXMLParserDelegate&gt;
  
     @property(nonatomic, weak) id&lt;parsingComplete&gt; delegate;
     @end
  </code></pre>
  
  <p>After parsing complete I want this delegate to trigger. so i am doing something like this.</p>
  
  <pre><code>- (void)parserDidEndDocument:(NSXMLParser *)parser
  {
      if (delegate) 
      {
          [delegate updateUI:food];
      }
   }
  </code></pre>
  
  <p>Here the delegate value is <code>nil</code>. Anyone understand the source of this problem. </p>
  
  <p>And i am invoking my delegate like this.
  here is .h file
  {</p>
  
  <pre><code> @interface NHMainViewController : UIViewController&lt;parsingComplete&gt;
  
   @property(nonatomic, strong)ATAFoodParser *foodParser;
   @end
  </code></pre>
  
  <p>}</p>
  
  <p>here is .m file</p>
  
  <p>{</p>
  
  <pre><code>@implementation NHMainViewController
  
   - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
   {
       self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
         // Custom initialization
        }
        return self;
  }
  
  - (void)viewDidLoad
  {
       [super viewDidLoad];
       self.foodParser = [[ATAFoodParser alloc] init];
       self.foodParser.delegate = self;
  // Do any additional setup after loading the view.
   }
  
  
  -(void) updateUI:(NSMutableDictionary*)foodList{
         NSLog(@"Dictionary:----&gt;%@", foodList);
   }
  
  @end
  </code></pre>
  
  <p>}</p>
  
  <p>updateUI is a my delegate method, which should get invoked. i am not getting call back here.
  i went to my first class where i have created my protocol, i printed delegate.. it is nil..</p>