请帮我!
我像这样从 Parse.com 下载图像:
self.images = [[NSMutableArray alloc] init];
PFImageView *creature = [[PFImageView alloc] init];
PFQuery *query = [PFQuery queryWithClassName:@"SubCatergory"];
[query findObjectsInBackgroundWithBlock:^(NSArray *comments, NSError *error) {
for (PFObject *comment in comments) {
PFFile *file = [comment objectForKey:@"imageFile"];
creature.file = file;
creature.frame = CGRectMake(0, 0, 100, 100);
// creature.userInteractionEnabled =YES;
[creature loadInBackground];
//[self.images addObject:creature];
[self.images addObject: creature];
}
}];
把这些放在 iCarousel 中:
-(UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
PFImageView* img = [self.images objectAtIndex:index];
PFImageView* imgView = [[PFImageView alloc] initWithImage:img];
return img;
}
使用本地图像 iCarousel 效果很好。我设置了代表和数据源。我的图像数组的内容是这样的:
>", "
我得到了错误:
[PFImageView 长度]:无法识别的选择器发送到实例 0xf40e9d0