- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
处理 JSON 数据并从字典中提取图像并将图像添加到数组
NSURL *imageurl=[NSURL URLWithString:(NSString *) Dictionry[@"product"][@"image_medium_url"]];
NSData *data = [NSData dataWithContentsOfURL:imageurl];
UIImage *image = [UIImage imageWithData:data];
[self.productImageArray addObject:image];
我正在将这个数组复制到另一个数组
for(int i=0;i<prodReq.productNameArray.count;i++)
{
[productimageA addObject:[[prodReq.productImageArray objectAtIndex:i] mutableCopy]];
}
并将图像设置为 ImageView
UIImageView *productimage=[[UIImageView alloc]initWithFrame:CGRectMake(15, prodimgY, 60, 75 )];
productimage.image=[productimageA objectAtIndex:indexPath.row];
当我运行这个项目时出现这个错误
-[UIImage mutableCopyWithZone:]: unrecognized selector sent to instance 0x14581240
有什么问题吗?
最佳答案
您正在将 UIImage 添加到 productImageArray。您不需要为 UIImage 对象添加 mutableCopy。所以就用
[productimageA addObject:[prodReq.productImageArray objectAtIndex:i] ];
关于ios - 出现错误 [UIImage mutableCopyWithZone :]: unrecognized selector sent to instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20673385/
我正在关注此站点的 Core Data 教程 http://www.appcoda.com/introduction-to-core-data/ 但是我收到以下错误: 2016-06-23 17:55
我读了其他一些关于它的主题,但我仍然迷路了。 我想创建两种对象,一种是只有“只读”属性的不可变对象(immutable对象),另一种是只有“读写”属性的可变对象。 我们称它们为 EXCar 和 EXM
我试图制作一个包含 5 个实例变量的行星对象的 mutableCopy(其中一个是字符串文字的 NSMutableArray。我的问题是我不确定如何将 newPlanet>data 设置为 self>
我创建了一个符合 NSCopying 的自定义类和NSMutableCopying . 我添加了 -copyWithZone: 的实现和-mutableCopyWithZone: ,但每当我打电话 -
处理 JSON 数据并从字典中提取图像并将图像添加到数组 NSURL *imageurl=[NSURL URLWithString:(NSString *) Dictionry[@"product
我是一名优秀的程序员,十分优秀!