How do i get the file which is saved under
-(NSString *) dataFilePath
{
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [path objectAtIndex:0];
return [documentDirectory stringByAppendingPathComponent:@"Answer.plist"];
}
NSString *filePath = [self dataFilePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{ NSArray *array = [[NSArray alloc] initWithContentsOfFile:filePath];
NSLog(@"%@\n",array);
NSLog(@"%@\n", filePath);
}
and is there any way any way to add items to the plist without overwriting it?
You can use this:
or