title: moving objects in NSMutableArray without changing array size
body: <p>I have a 'MutableArray' that I want to edit by moving different objects in it up and down the index via the method shown here: <a href="https://stackoverflow.com/questions/4349669/nsmutablearray-move-object-from-index-to-index">NSMutablearray move object from index to index</a>.</p>
  
  <p>My problem is that Xcode first takes care of the 'removeObjectAtIndex' method before the 'insertObject:atIndex:' so the array actually shrinks in size which makes certain transitions impossible. An example would be if my 'array' has 3 members and I change the third member's index from 2 to 2 so nothing should happen but actually the app crashes because after the removal the index bound is now [0,1]. </p>
  
  <p>Below is the code I am using to implement the move in array, I also get a Parse Issue: Expected identifier error from the compiler at the 'if' statement right behind the <code>queue.count</code>. Any help on both would be much appreciated.</p>
  
  <pre><code>-(void)makeRankChange:(NSMutableArray *)queue{
      for (int queueCount =0; queueCount&lt;queue.count; queueCount++) {
          QueueMember *member = [queue objectAtIndex:queueCount];
          if (member.rank != queueCount+1) {
              if ([0&lt;member.rank] &amp;&amp; [member.rank &lt; [queue.count(expected identifier here:Im not sure why)]]) {
                  [queue insertObject:member atIndex:member.rank-1];
                  [queue removeObjectAtIndex:queueCount];
              }
  
          }
      }
  }
  </code></pre>