title: Returning multiple values from a method in Objective-C
body: <p>I asked a similar question, but I couldn't get it working exactly. I'm building an iPhone app, and there is a method that I want called from different files. I figured the easiest way would simply be to make a method in another file, and call the method from the other files.</p>
  
  <p>Here are some problems. I need to return multiple values from the method, after passing it multiple values. For example, I'm passing it: <code>(int, int, int, string, string)</code>.  And it needs to return all of those values, after they have been changed. Someone showed me this code:</p>
  
  <pre><code>- (NSDictionary *)EndOfTurn:(int)varTurns withFatness:(int)varFatness
  {
      varTurns--;
  
      if (varTurns &lt;= 0) {
          varFatness = varFatness - 5;
      }
      else {
          varFatness += 2;
      }
  
      return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:varFatness], @"FATNESS", [NSNumber numberWithInt:varTurns], @"TURNS", nil];
  
  }
  </code></pre>
  
  <p>However, this code doesn't work, and I need some more information to really understand it.  Let's assuming I'm passing it these values:</p>
  
  <pre><code>int varMoney;
  int varNumSheep;
  int varNumShepherds;
  NSString *test1;
  NSString *test2;
  </code></pre>
  
  <p>So I need to get all of these values back from the method.</p>
  
  <p>How do I declare this in the header file?  This should be in an Objective-C file, but could you give me the code for the entire file so I can see where it would go with the <code>@implementation</code> and <code>@end</code>, whatnot.  Also, how would I call this method?</p>