title: How to compare two NSArrays for equal content in any order?
body: <p>I have two <code>NSArray</code>s where the objects of the arrays are the same but might be in different indices. It should print both are equal irrespective of their indices.</p>
  <pre><code>NSArray *arr1 = [[NSArray alloc]initWithObjects:@&quot;aa&quot;, @&quot;bb&quot;, @&quot;1&quot;, @&quot;cc&quot;, nil];
  NSArray *arr2 = [[NSArray alloc]initWithObjects:@&quot;bb&quot;, @&quot;cc&quot;, @&quot;1&quot;, @&quot;aa&quot;, nil];
  
  if ([arr1 isEqualToArray:arr2])
  {
      NSLog(@&quot;Equal&quot;);
  }
  else
  {
      NSLog(@&quot;Not equal&quot;);
  }
  </code></pre>
  <p>The above code is printing <code>'Not equal'</code> but it should print <code>'Equal'</code>. How can I do this?</p>