title: Making NSArray a NSMutableArray inside an if condition
body: <p>I have a array inside my init method and then I wish to make a mutable array inside if condition when it's actually needed. Is it possible?</p>
  
  <p>Presently am doing:</p>
  
  <pre><code>- (id)init
  {
     self = [super init];
  
     if (self)
     {
        // [MyClass someMethod] in the below statement returns an array.
        NSMutableArray *someArray = [NSMutableArray arrayWithArray:[MyClass someMethod]];
  
        if (this condition is true)
        {
             [someArray addObject:@"XYZ"];
        }
  
       // Print someArray here.
     }
  }
  </code></pre>
  
  <p>What I am trying to do it:</p>
  
  <pre><code>- (id)init
      {
         self = [super init];
  
         if (self)
         {
            // [MyClass someMethod] in the below statement returns an array.
            NSArray *someArray = @[[MyClass someMethod]];
  
            if (this condition is true)
            {
                 // Make some array mutable here and then add an object to it.
                 [someArray mutableCopy];
                 [someArray addObject:@"XYZ"];
            }
  
           // Print someArray here.
         }
      }
  </code></pre>
  
  <p>Am I doing it right? Or is what I am thinking possible? Can I make the same array mutable whenever needed as in my case I need it to be mutable only if my condition in if is true.</p>