2 u010386344 u010386344 于 2013.12.17 22:00 提问

新手求教,ios开发遇到的NSInvalidArgumentException问题

代码:-(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'
键值明明已经附值了,为何显示没有呢?

1个回答

u013243469
u013243469   2014.11.26 13:12

打个断点看看就知到加没加上了

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!