In my and successBlock below, Im saving the info
to my NSMutableArray
selectedPhotos
. BTW, the info
is a ALAsset url
. URLs from my camera roll.
} andSuccessBlock:^(NSArray *info)
[self.selectedPhotos setArray:info];
What I needed to do is save it via NSUserDefaults
.
Here is how I save it in NSUserDefaults
:
[[NSUserDefaults standardUserDefaults] setObject:self.selectedPhotos forKey:@"PickedImage"];
self.selectedPhotos = [[NSUserDefaults standardUserDefaults] objectForKey:@"PickedImage"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSLog(@"SelectedPhotos:: %@", self.selectedPhotos);
But the problem is, when I log it it says NULL
.
How can I save my array via NSUserDefaults
. Thanks for the help.
LOG:
SelectedPhotos:: (null)
*** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value '(
"ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=119A0D2D-C267-4B69-A200-59890B2B0FE5&ext=JPG",
"ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=92A7A24F-D54B-496E-B250-542BBE37BE8C&ext=JPG",
"ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=77AC7205-68E6-4062-B80C-FC288DF96F24&ext=JPG" )' of class '__NSArrayM'. Note that dictionaries and arrays in property lists must also contain only property values.