I am trying to save an NSMutableArray
in CoreData
. The Array contains objects NSDictionary
NSDictionary has following Structure
valueDict =
{
FloorId = F0001;
endCoordinates = "NSPoint: {541, 413}";
linePath = "<UIBezierPath: 0x1d0903c0>";
pointsOnLine = (
);
startCoordinates = "NSPoint: {418, 504}";
},
To write to the Core Data I use following code: parray is type BinaryData
points.parray = [NSKeyedArchiver archivedDataWithRootObject:self.locationsArray];
and to retrieve value I use
locationsArray = [NSKeyedUnarchiver unarchiveObjectWithData:points.parray];
When I try to retrieve it i get following error :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSDictionary initWithObjects:forKeys:]: count of objects (0) differs from count of keys (5)'
I have checked that NSArray and NSDictionary adopts NSCoding protocol. What am I doing wrong here ?