I have a NSMutableArray. It can be empty or have a number of propertyList objects (In my case just NSNumber objects). I want to save it to disk in xml format, so I'm using.
// In the interface
@property (nonatomic, retain) NSMutableArray *myArray;
// In the implementation
if ([self.myArray writeToFile:pathToFile atomically:YES])
{
// Success
} else {
// Failure
}
If the array is empty ( an empty initialized NSMutableArray) in the moment the method is called the method returns NO and the operation is not done, so the old data is not overwritten.
How can I write an empty array to disk?