title: AFNetworking callbacks - delegate or notification?
body: <p>I have a question on which is best way or the correct way to send AFNetworking results to controller. Is it via delegate or notification?</p>
  
  <p>I created a class to handle make API calls that has the code below. So if imported this class to another controller and call this method to make API call. Should I do delegate or notification?</p>
  
  <p>I have read <a href="http://www.raywenderlich.com/59255/afnetworking-2-0-tutorial" rel="nofollow">www.raywenderlich.com/59255/afnetworking-2-0-tutorial</a> and it is using delegates. I also been watched CodeSchool tutorial, which they used notification from Model to Controller. </p>
  
  <p>I added the code below in a hope to better show my question.</p>
  
  <pre><code>AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
  
  // notification way inside the BLOCK
  [ manager GET:path parameters:params
       success:^(NSURLSessionDataTask *operation, id responseObject) {
           [ [NSNotificationCenter defaultCenter] postNotificationName:notificationName
                                                                object:nil
                                                              userInfo:responseObject ];
  
       } failure:^(NSURLSessionDataTask *operation, NSError *error) {
           [ [NSNotificationCenter defaultCenter] postNotificationName:notificationName
                                                                object:nil ];
       }];
  
  // delegate way inside the BLOCK
  [ manager GET:path parameters:params
       success:^(NSURLSessionDataTask *operation, id responseObject) {
  
         if ([delegate respondsToSelector:@selector(getUserFeedsDidFinish:resultDict:)])
         {
              [delegate performSelector:@selector(getUserFeedsDidFinish:resultDict:) withObject:self withObject:resultDict];
         }
  
       } failure:^(NSURLSessionDataTask *operation, NSError *error) {
         if ([delegate respondsToSelector:@selector(getUserFeeds:didFailWithResultDict:)]) {
             [delegate performSelector:@selector(getUserFeeds:didFailWithResultDict:)
                            withObject:self
                            withObject:[NSDictionary dictionaryWithObject:error.userInfo forKey:KEY_ERRORS]];
          }
       }];
  </code></pre>