UPDATED This is my code; the last line of code caused the error as described in the title. I understand userDefaults will always return an immutable object; so how do I fix this? I tried making the sending field a "mutable copy" but it was flagged as an error.
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   if(textField.tag == kStaffName)  {  //  get index of staffName textField
    NSMutableArray *staffNamesArray = [[userDefaults arrayForKey:@"staffNamesArray"] mutableCopy];
    NSInteger indexSelected = [oStaffPickerView selectedRowInComponent:0];
    [staffNamesArray replaceObjectAtIndex:indexSelected withObject:textField.text];