代码:-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
NSString *oldPhotoKey=[self.diary photoKey];
if(oldPhotoKey){
[[ImageStore defaultImageStore]deleteImageForKey:oldPhotoKey];
}
UIImage *Image=[info objectForKey:UIImagePickerControllerOriginalImage];
CFUUIDRef newUniqueID=CFUUIDCreate(kCFAllocatorDefault);
CFStringRef newUniqueIDString=CFUUIDCreateString(kCFAllocatorDefault, newUniqueID);
NSString *photoKey1=(__bridge NSString *)newUniqueIDString;
self.diary.photoKey=photoKey1;
CFRelease(newUniqueIDString);
CFRelease(newUniqueID);
[[ImageStore defaultImageStore] setImage:Image forKey:self.diary.photoKey];
[self.picture setImage:Image];
[self dismissViewControllerAnimated:YES completion:nil];
}
debug:2013-12-17 13:34:53.827 Mydiary[1119:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil'
键值明明已经附值了,为何显示没有呢?