title: iOS, how to get subarray from an array using subarraywithRange
body: <p>I am having problem with using subArrayWithRange.</p>
  
  <p>Basically, what I want to do is make subarray of 50 elements or less from mainArray
  for example if mainArray has 70 elements I want a sortedArray to have an array of first 50 elements in first index and another array of 20 elements in the last index of sortedArray</p>
  
  <p>Hope I am clear what I want to do get.</p>
  
  <p>anyway, my code is </p>
  
  <pre><code>for (int i=0; i&lt;=ceilLoopCount; i++) {
      [sortedArray insertObject:[testArray subarrayWithRange:NSMakeRange(0,50)] atIndex:i]; 
  } 
  </code></pre>
  
  <p>and the problem I am having is I only get the same 50 elements in all the array</p>
  
  <p>Please help,
  Pondd</p>