title: How to differentiate the returned value of a function using completion block in Objective C?
body: <p>I have a function that gives 2 different String values that are returned :</p>
  
  <pre><code>-(NSString*)load:(NSDictionary *)dict
  {
  
      NSDictionary *dataDict = [self objectForId:@"data" fromDict:dict withDefault:nil];
      if (dataDict) {
          NSDictionary *success = [self objectForId:@"success" fromDict:dataDict withDefault:nil];
  
          NSString *str = [NSString stringWithFormat:@"%@", success];
  
          if ([str isEqualToString: @"1"])
          {
              NSDictionary *idDict = [self objectForId:@"id" fromDict:dataDict withDefault:nil];
              if (idDict) {
                  NSString *idString = [NSString stringWithFormat:@"%@", idDict];
                  return idString;
              }
  
          } else {
              NSDictionary *messages = [self objectForId:@"messages" fromDict:dataDict withDefault:nil];
              if (messages) {
                  NSDictionary *messageDict = (NSDictionary *)messages;
                  NSArray *type = messageDict[@"type"];
                  if (type.count &gt; 0) {
                      NSString *messageString = type[0][@"message"];
                      return messageString;
                  }
              }
          }
      }
      return  nil;
  }
  </code></pre>
  
  <p>And accessing the stringValue like this :                </p>
  
  <pre><code> NSString *string = [className load:dict];
  </code></pre>
  
  <p>Now I want to write if else statements for "idString" and "messageString" return values. How do I differentiate the 2 return values?</p>