在下面的 my 和 successBlock 中,我将其保存info
到我的NSMutableArray
selectedPhotos
. 顺便说一句,这info
是一个ALAsset url
. 我的相机胶卷中的 URL。
} andSuccessBlock:^(NSArray *info)
[self.selectedPhotos setArray:info];
我需要做的是通过NSUserDefaults
. 这是我保存它的方法NSUserDefaults
:
[[NSUserDefaults standardUserDefaults] setObject:self.selectedPhotos forKey:@"PickedImage"];
self.selectedPhotos = [[NSUserDefaults standardUserDefaults] objectForKey:@"PickedImage"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSLog(@"SelectedPhotos:: %@", self.selectedPhotos);
但问题是,当我记录它时,它说NULL
. 如何通过NSUserDefaults
. 谢谢您的帮助。
日志:
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.