I am trying to append to an array plist but have been unsuccessful. I'm not sure what I'm doing wrong. I don't get any errors but it doesn't append the test string.
PHP Code:
-(NSString *) saveFilePath
{
NSArray *pathArray =
NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"project.plist"];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSString *myPath = [self saveFilePath];
NSString *test = @"Code";
NSMutableArray *values = [[NSMutableArray alloc] initWithContentsOfFile:myPath];
[values addObject:test];
[values writeToFile:[self saveFilePath] atomically:YES];
[values release];
[super viewDidLoad];
}