How to generate all available permutations of NSArray elements
<p>friends and sirs...</p>

<p>If I have an NSArray of NSNumbers like this: 1, 2, 3</p>

<p>Then the set of all possible permutations would look something like this:</p>

<blockquote>
  <p>1<br>
  2<br>
  3<br>
  1 , 2<br>
  1 , 3<br>
  2 , 3<br>
  2 , 1<br>
  3 , 1<br>
  3 , 2<br>
  1 , 2 , 3<br>
  1 , 3 , 2<br>
  2 , 1 , 3<br>
  ...</p>
</blockquote>

<p>What's a good way to do this in XCode?</p>

<p>Please help me...</p>

<p>thanks.</p>
