Oops. I was missing an allocate of the values array. Try this:
Code:
- (void)viewDidLoad {
NSString *myPath = [self saveFilePath];
NSString *test = @"Code";
NSArray *fileArray = [[NSArray alloc] initWithContentsOfFile:myPath];
NSMutableArray* values = [NSMutableArray arrayWithCapacity: [fileArray count] +1];
[values addObjectsFromArray: fileArray];
[fileArray release];
[values addObject:test];
[values writeToFile:[self saveFilePath] atomically:YES];
[super viewDidLoad];
}
In that code, we create a new mutable copy of the array, sizing it to hold one more object than the array read from the file.