title: How to re-alloc an array
body: <p>I need to refill an NsMutableArray as follows.I am wondering if there's any safety problems in this way. thanks in advance! </p>
  
  <pre><code>int main(int argc, const char * argv[])
  {
      @autoreleasepool 
      {
  
          NSMutableArray *myArray = [NSMutableArray arrayWithCapacity:4];
          [myArray addObject:@"something1"];
          [myArray addObject:@"something2"];
          [myArray addObject:@"something3"];
          [myArray addObject:@"something4"];
  
      myArray = [NSMutableArray arrayWithCapacity:3];
          [myArray addObject:@"somethingNew1"];
          [myArray addObject:@"somethingNew2"];
          [myArray addObject:@"somethingNew3"];
  
      }
      return 0;
  }
  </code></pre>