I set the NSURLSessionDownloadTask
in NSMutableDictionary
. Then I want to save this dictionary in NSUserDefaults
.
I know that I can't save custom object in NSUserDefaults
and, after searching, I've found this answer: How to store custom objects in NSUserDefaults, but I couldn't implement to my code.
Here is part of my code:
[self.downloadTasksDictionary setObject:dlTask forKey:[NSString stringWithFormat:@"%@",customId]];
[[NSUserDefaults standardUserDefaults] setObject:self.downloadTasksDictionary forKey:@"DownloadTaskDict"];
[[NSUserDefaults standardUserDefaults] synchronize];
Is there any way to save this NSMutableDictionary
in NSUserDefaults
?
Thanks.