The App will save the NSMutableArray into a archive with no problems but as soon as I try and load the NSMutableArray back into a new NSMutableArray @ viewDidLoad the app will crash. I put a break point at the end of the code where "tempArray = [unarchiver decodeObjectForKey:kDataKey46];" and tempArray is being loaded with the archived array but when I go through the "for" loop @ "[poolListData addObject:testTemp];" "poolListData" does not hold the data from "tempArray". Also if I did not use a break point and just let the app try to load, the app will crash...What do you guys think?
Thank you for your time! Jeff
NSString *filePath = [self dataFilePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
NSData *data = [[NSMutableData alloc] initWithContentsOfFile:[self dataFilePath]];
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
field1.text = [unarchiver decodeObjectForKey:kDataKey1];
// snip another bunch of fields
field37.text = [unarchiver decodeObjectForKey:kDataKey37];
soundOn = [unarchiver decodeBoolForKey:kDataKey38];
soundVolumeSlider.value = [unarchiver decodeDoubleForKey:kDataKey39];
soundVolumeValue = [unarchiver decodeDoubleForKey:kDataKey39];
tempArray = [unarchiver decodeObjectForKey:kDataKey46];
[unarchiver finishDecoding];
for(int i = 0; i < [tempArray count]; i++)
{
NSData *testTemp = 0;
//NSString *temp = [tempArray objectAtIndex:i];
testTemp = [tempArray objectAtIndex:i];
[poolListData addObject:testTemp];
//[poolListData addObjectsFromArray:tempArray];
}
/*
firstNameTextField.text = field1.text;
lastNameTextField.text = field2.text;
adressTextField.text = field3.text;
emailTextField.text = field4.text;
*/
[tempArray release];
[unarchiver release];
[data release];
}