I’m using
[NSKeyedArchiver archiveRootObject:data toFile:file];
to save NSMutableArray to file. That works fine.
The problem comes when I try to get the array back.
NSMutableArray *s = [NSKeyedUnarchiver unarchiveObjectWithData:file];
Here I get
Incompatible pointer types sending NSString *__strong to parameter of type NSData
What is wrong here ?
You are trying to use
unarchiveObjectWithData:, which expects you to pass it the contents of the file. Try usingunarchiveObjectWithFile:instead, which expects you to pass it the filename.