Array of Arrays - writing to File problem
- by iFloh
Hi,
and again my array of arrays ... I try to improve my app performance by buffering arrays on file for later reuse.
I have an NSMutableArray that contains about 30 NSMutableArrays with NSNumber, NSDate and NSString Objects.
I try to write the file using this call:
bool result = [myArray writeToFile:[fileMethods
getFullPath:[NSString
stringWithFormat:@"iEts%@.arr",
[aDate shortDateString]]]
atomically:NO];
= result = FALSE.
The Path method is:
+ (NSString *) getFullPath:(NSString *)forFileName {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:forFileName];
}
and the aDate call returns a shortDateString with ddMMyy.
The NSLog
NSLog(@"%@", [fileMethods getFullPath:[NSString stringWithFormat:@"iEts%@.arr",
[aDate shortDateString]]]);
on the path generation returns:
/Users/me/Library/Application Support/iPhone Simulator/User/Applications/86729620-EC1D-4C10-A799-0C638BB27933/Documents/iEts010510.arr
FURTHER:
It must have something to do with the
Array of Arrays, since I also write 3
further simple arrays (containing
NSStrings) that all succeed.
The Array of Arrays gets generated using the addObject method
Any ideas what could cause the trouble?