简体   繁体   English

为什么我在[字典长度]上出现错误?

[英]Why am I getting an error in [dictionary length]?

Here i want to display image url to the image view, 在这里,我想显示图片网址到图片视图,

NSData *imageData= [[[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[sharedDelegate.getHotListArray  objectAtIndex:indexPath.row]]]objectForKey:@"image"];
cell.userGetHotImgView.image=[UIImage imageWithData:imageData];

Here i got error like dictionary length ? 在这里我得到像字典长度的错误? Please help me how can i pass the array of image url to nsdata ? 请帮助我如何将图像URL数组传递给nsdata?

Thank you in-advance. 先感谢您。

In the code you have posted you are creating an NSData object and then calling objectForKey: on it. 在发布的代码中,您将创建一个NSData对象,然后在其上调用objectForKey: This is not a method of NSData. 这不是NSData的方法。

Just assign the NSData you created to your imageData variable. 只需将创建的NSData分配给imageData变量即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM