title: Error with NSUserDefaults , while setting NSMutable array as object in iOS, objective C
body: <p>I tried to set <code>NSMutableArray</code> as object in <code>NSUserDefault</code>.but it gives following error.</p>
  
  <blockquote>
    <p><strong>Attempt to set a non-property-list</strong></p>
  </blockquote>
  
  <p>this is how I tried it.</p>
  
  <pre><code>[[NSUserDefaults standardUserDefaults] setObject:OutboundArray forKey:@"outbound"];
    [[NSUserDefaults standardUserDefaults] synchronize];
  </code></pre>
  
  <p><strong>NOTE :</strong> <code>OutboundArray</code> type is NSMutableArray. What is the wrong with this.I do this inside a method.hope your help.</p>
  
  <p>this is how I assign value to OutboundArray</p>
  
  <pre><code>- (void)assignvaluedForarrays
  {
      OutboundArray = nil;
      InboundArray = nil;
  
      FlightSearchSelected *flightSearch = [FlightSearchSelected new];
      JourneyTy = flightSearch.returnJType;
      DirectRNot = flightSearch.returnNonStoporNot;
      fromAcode = flightSearch.returnFromPort;
      toAcode = flightSearch.returnToPort;
  
      FlightCnt = FinalDetails.FlightCount;
  
  
      OutboundArray = [NSMutableArray array];
      InboundArray = [NSMutableArray array];
  
  
      //all round trips
      if ([JourneyTy isEqualToString:@"true"])
      {
  
              for (int i=0;i&lt;FlightCnt;i++)
              {
                  FinalValues *finalValue = testingArray[i];
                  NSString *legNumber = finalValue.legnumber;
  
                  if ([legNumber isEqualToString:@"1"])
                  {
                      [OutboundArray addObject:testingArray[i]];
  
                  }
                  else
                  {
                      [InboundArray addObject:testingArray[i]];
                  }
              }
  
  
      }
      //only one ways trips
      else
      {
          self.finaltableViewbottomLayout.constant = 180;
          for (int i = 0;i&lt;FlightCnt;i++)
          {
              [OutboundArray addObject:testingArray[i]];
  
          }
  
      }
  }
  </code></pre>
  
  <p>*testingArray data comes from the previous view controller according to indexpath of the table view.</p>