Issue in Using AsyncImageView in icarousel in iOS
icarousel, ios, objective-c, uiimageview, xcode
Solution
Follow these steps maybe because of following reasons you may face this issue
-- Check whether if ur imageURLs array is having objects under iCarousel are not...If its null you may have this kind of issue....
-- Do array allocation and add objects in
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
method,because if you add objects in your array under viewDidLoad it won't works because carousel view loads first before viewDidLoad method..
-- if your array element is present even after these steps follow this code.
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(AsyncImageView *)view
{
view = [[[AsyncImageView alloc]initWithFrame:CGRectMake(0, 0, 300, 280)] autorelease];
view.image=[UIImage imageNamed:@"infobg.png"];
view.imageURL=[imageURLs objectAtIndex:index];
//NSLog(@"%@",imageURLs)//check imageURLs having object
if(view ==nil)
{
[[AsyncImageLoader sharedLoader]cancelLoadingImagesForTarget:view];
}
return view;
}
It will help you..
Problem
I have developed an app which uses Asyncimageview and iCarousel.But my issues is that when i'm trying to load the images from urls only activity indicator loads in each view of my iCarousel and no images are loaded.Here is my code ``` - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(AsyncImageView *)view { if (view == nil { AsyncImageView * view = [[[AsyncImageView alloc]initWithFrame:CGRectMake(0, 0, 300, 280)] autorelease]; view.image=[UIImage imageNamed:@"infobg.png"]; view.imageURL=[imageURLs objectAtIndex:index]; } return view; } ```