1

Building for MacOS, In one of my classes, I am conforming to the NSCoding protocol to encode the properties of my objects and save them to a plist using this method:

[NSKeyedArchiver archiveRootObject:employees toFile:@"/Users/user1/Desktop/emplyees.plist"]; //employees is an NSMutableArray

This method successfully creates a new plist and saves the data on the desktop. My question is, assume that I already have a plist in my project files, How can I save the data directly to that plist and append it every time I use a sender to add a new Employee object?

Fady E
  • 346
  • 3
  • 16

1 Answers1

1

It seems like the only way is by appending the new objects to the employees array, using [employees addObject:newEmployee], and overwrite the old plist with a new one that includes the old objects.

Fady E
  • 346
  • 3
  • 16