title: AFNetworking - call function inside
body: <p>I'm using AFNetworking and i have a question about it, i want call one different function when return value correct</p>
  
  <pre><code>- (AFHTTPRequestOperation *)GET:(NSString *)URLString
  
                       parameters:(id)parameters
  
                          success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
  
                          failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
  
  {
  
      AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:^(AFHTTPRequestOperation
  *requestOperation, __unused id responseObject) {
  
          if (success) {
  
              int status = [[responseObject objectForKey:@"Status"] intValue];
  
  
  
              else if(status == -1)
  
              {
  
                  [self HTTPRequestOperationWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:^(AFHTTPRequestOperation *requestOperation, __unused id responseObject) {
  
                      if (success) {
  
                          NSLog(@"adfasdfasdfasdf");
  
                          success(requestOperation,responseObject);
  
                      }
  
                  } failure:^(AFHTTPRequestOperation * operation, NSError *error) {
  
                      NSLog(@"ERROR: %@", error);
  
                      failure(nil, error);
  
                  }];
  
  
  
              }
  
              else
  
                  success(requestOperation,responseObject);
  
          }
  
      } failure:failure];
  
      operation.securityPolicy.allowInvalidCertificates = YES;
  
      operation.securityPolicy.validatesDomainName = NO;
  
      [self.operationQueue addOperation:operation];
  
  
  
      return operation;
  
  }
  </code></pre>
  
  <p>when status = -1. I'll call more function with param above, but dosen't work. </p>
  
  <pre><code>else if(status == -1)
  
              {
  
                  [self HTTPRequestOperationWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:^(AFHTTPRequestOperation *requestOperation, __unused id responseObject) {
  
                      if (success) {
  
                          NSLog(@"adfasdfasdfasdf");
  
                          success(requestOperation,responseObject);
  
                      }
  
                  } failure:^(AFHTTPRequestOperation * operation, NSError *error) {
  
                      NSLog(@"ERROR: %@", error);
  
                      failure(nil, error);
  
                  }];
  
  
  
              }
  </code></pre>
  
  <p>run app and I bug function not call to success or failure.</p>