I need to save array in core data, so i read that I can use NSData for it. So I think that I have problem with archiving.
NSMutableArray *newArray = [[NSMutableArray alloc]init];
NSData *newData = [NSKeyedArchiver archivedDataWithRootObject:newArray];
[myEntity setValue:newData forKey:@"nameOfMyData"];
And then I try to pick my array in another VIewController for filling
NSData *newdata = [NSData dataWithData:self.myEntity.nameOfMyData];
NSMutableArray *photoArray = [[NSMutableArray alloc]init];
photoArray = [NSKeyedUnarchiver unarchiveObjectWithData:newdata];
I have no crash, but in command line appear next:
[NSKeyedUnarchiver initForReadingWithData:]: data is empty;
did you forget to send - finishEncoding to the NSKeyedArchiver?
And when i try to add object to my array, it does not add
[photoArray addObject:myImage];
So myImage is creating and with it I have no trouble, but in debugger always write for photoArray:
photoArray = (NSMutableArray*) 0x00000000 0 objects