title: Objective-C blocks: How to set an object to nil which uses block-based callback mechanism?
body: <p>I have a NetworkManager class which does the task of connecting to a JSON based web service and returning the server response. I am using a completion handler block to return the success or error response from NetworkManager (Internally, NetworkManager uses delegate based NSURLConnection).</p>
  
  <pre><code>NetworkManager *objNetworkManager= [[NetworkManager alloc]init];
  
  [objNetworkManager setCompletionHandler:^(NSDictionary *resp, BOOL isSuccess){
      if (isSuccess) {
  
      }else{
  
      }
  }];
  
  [objNetworkManager initiateUrlRequestWithInput:jsonRequestInput];
  </code></pre>
  
  <p>Everything works fine now and my network requests work as expected using this NetworkManager class. My concern is that <strong>I am allocating an instance of NetworkManager each time I make an web service call. But, where should I set the objNetworkManager to nil? Because it uses a block callback, I'm not sure how to handle memory efficiently</strong>. Please advice!!</p>