I have a plist written from a NSMutableArray by [NSMutableArray writeToFile]. When trying to load that same plist with the following code:
NSArray *testArray = [NSArray arrayWithContentsOfFile:[self pathForDataFile:@"reportingSpeicher.plist"]];
NSLog(@"count = %@",[testArray count]);
I get bad access on the count or on any other operation I try on testArray. BUT:
NSLog(@"testArray = %@", testArray);
correctly returns:
testArray = (
{
benutzername = "t.h";
datum = "2010-07-15";
dauerInStunden = 1;
phasenName = "Projektsteuerung,32";
projektName = "projekt AG,23";
soapSpeicher = {
PasswortAsMD5 = someMD5sum;
benutzername = "t.h";
datum = "2010-07-15";
dauerInStunden = 1;
phasenid = 32;
projektid = 23;
taetigkeit = whateveryoudid;
};
taetigkeit = whateveryoudid;
} )
I'm guessing there is either some basic memory management involved or the type returned is somehow corrupted/not an NSArray. Those three lines should really be simple enough - I just can't get it to work. I'd appreciate any help!