title: Attempt to set a non-property-list object as an NSUserDefaults
body: <p>I thought I knew what was causing this error, but I can't seem to figure out what I did wrong.</p>
  
  <p>Here is the full error message I am getting:</p>
  
  <pre>
  Attempt to set a non-property-list object (
     "&lt;BC_Person: 0x8f3c140&gt;"
  ) as an NSUserDefaults value for key personDataArray
  </pre>
  
  <p>I have a <code>Person</code> class that I think is conforming to the <code>NSCoding</code> protocol, where I have both of these methods in my person class:</p>
  
  <pre><code>- (void)encodeWithCoder:(NSCoder *)coder {
      [coder encodeObject:self.personsName forKey:@"BCPersonsName"];
      [coder encodeObject:self.personsBills forKey:@"BCPersonsBillsArray"];
  }
  
  - (id)initWithCoder:(NSCoder *)coder {
      self = [super init];
      if (self) {
          self.personsName = [coder decodeObjectForKey:@"BCPersonsName"];
          self.personsBills = [coder decodeObjectForKey:@"BCPersonsBillsArray"];
      }
      return self;
  }
  </code></pre>
  
  <p>At some point in the app, the <code>NSString</code> in the <code>BC_PersonClass</code> is set, and I have a <code>DataSave</code> class that I think is handling the encoding the properties in my <code>BC_PersonClass</code>.
  Here is the code I am using from the <code>DataSave</code> class:</p>
  
  <pre><code>- (void)savePersonArrayData:(BC_Person *)personObject
  {
     // NSLog(@"name of the person %@", personObject.personsName);
  
      [mutableDataArray addObject:personObject];
  
      // set the temp array to the mutableData array
      tempMuteArray = [NSMutableArray arrayWithArray:mutableDataArray];
  
      // save the person object as nsData
      NSData *personEncodedObject = [NSKeyedArchiver archivedDataWithRootObject:personObject];
  
      // first add the person object to the mutable array
      [tempMuteArray addObject:personEncodedObject];
  
      // NSLog(@"Objects in the array %lu", (unsigned long)mutableDataArray.count);
  
      // now we set that data array to the mutable array for saving
      dataArray = [[NSArray alloc] initWithArray:mutableDataArray];
      //dataArray = [NSArray arrayWithArray:mutableDataArray];
  
      // save the object to NS User Defaults
      NSUserDefaults *userData = [NSUserDefaults standardUserDefaults];
      [userData setObject:dataArray forKey:@"personDataArray"];
      [userData synchronize];
  }
  </code></pre>
  
  <p>I hope this is enough code to give you an idea o what I am trying to do. 
  Again I know my problem lie with how I am encoding my properties in my BC_Person class, I just can't seem to figure out what though I'm doing wrong.</p>
  
  <p>Thanks for the help!</p>