title: IOS nsmutable array index no 2 insert one more value or dictionary with old value
body: <p>i have one mutable array with some value , In this array i have add one dictionary on index no 3 with old value , i mean to say i have add one more value on index no 3 Here is my data 
  **This is my mutable array **</p>
  
  <pre><code>(        {
          Amount = 40;
          DisplayMessage = "Select at least 1 item and a maximum of 1";
          DisplayOrder = 1;
          IsMandatory = 1;
          IsQtyEditable = 0;
  
      },
          {
          Amount = 30;
          DisplayMessage = "Select at least 1 item and a maximum of 1";
          DisplayOrder = 1;
          IsMandatory = 1;
          IsQtyEditable = 0;
  
      },
          {
          Amount = 10;
          DisplayMessage = "Select at least 1 item and a maximum of 1";
          DisplayOrder = 1;
          IsMandatory = 1;
          IsQtyEditable = 0;
  
      }
  )
  </code></pre>
  
  <p>on index no 3 i have add dictionary <strong>mytxt = 1;</strong>
  Like this (in last line i have add mytxt = 1; on index no 3 )</p>
  
  <pre><code>{
              Amount = 10;
              DisplayMessage = "Select at least 1 item and a maximum of 1";
              DisplayOrder = 1;
              IsMandatory = 1;
              IsQtyEditable = 0;
              mytxt = 1;
          }
  </code></pre>
  
  <p>Here is my code i try this but is return a error </p>
  
  <pre><code>for (int i =0; i&lt; ArrayGetParent.count; i++) {
  
                          if(i == 3 )
                          {
                              NSMutableDictionary *dictArray=[[NSMutableDictionary alloc]init];
                              [dictArray setValue:@"1" forKey:@"mytxt"];
                              NSLog(@"%@",dictArray);
                              [nishantArray insertObject:dictArray atIndex:i];
                          }
                      }
  </code></pre>
  
  <p>this is my error 
  <strong>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'</strong></p>
  
  <p>Please help me . please share your valuable knowledge . </p>