
int index = 0; int indexOfImages = 1; self.imageCache = [[SDImageCache alloc] initWithnamespace:@"menuImage"]; for ( UIImageVIEw *currentimageVIEw in cell.contentVIEw.subvIEws) { NSLog(@"the imageindex is: %d",indexOfImages); NSLog(@"the index is: %d",index); NSLog(@"the count is: %lu",(unsigned long)[self.currentProduct.mirsaProductUrlimage count]); if (index < [self.currentProduct.mirsaProductUrlimage count] ) { [self.imageCache @R_301_5962@diskCacheForKey:self.currentProduct.mirsaProductUrlimage[indexOfImages] done:^(UIImage *image,SDImageCacheType cacheType) { if (image) { currentimageVIEw.image = image; } }]; indexOfImages++; index++; } else { break; } } and if i try to change the loop way to this
for ( UIImageVIEw *currentimageVIEw in self.tableVIEw.subVIEws)
i got this error UItableVIEwWrapperVIEw setimage:]: unrecognized selector sent to instance
我只是想知道我是否以错误的方式循环,我的意思是我无法通过这个循环达到他们或发生了什么?
解决方法 你必须改变循环:for ( UIVIEw *currentVIEw in cell.contentVIEw.subvIEws) { if([currentVIEw isKindOfClass:[UIImageVIEw class]]) { // here Do All the stuff for imageVIEws } } 做所有这些东西在cellForRowAtIndexPath
并改变imageVIEw图像采取的弱视频imageVIEw这样的例子:
__weak UIImageVIEw *weakImage = currentimageVIEw; [self.imageCache @R_301_5962@diskCacheForKey:self.currentProduct.mirsaProductUrlimage[indexOfImages] done:^(UIImage *image,SDImageCacheType cacheType) { if (image) { weakImage.image = image; } }]; 总结 以上是内存溢出为你收集整理的ios – 在customCell中循环浏览uiimageview全部内容,希望文章能够帮你解决ios – 在customCell中循环浏览uiimageview所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)