how to load multiple images in iCarousel using this code?
Posted
by
Dany
on Stack Overflow
See other posts from Stack Overflow
or by Dany
Published on 2012-06-28T15:14:06Z
Indexed on
2012/06/28
15:15 UTC
Read the original article
Hit count: 479
i'm loading bunch of images in coverflow using i carousel but i'm not getting it?..initially i got Signal sigabart issue..after i edited some of the code the view gets displayed...Am i missing something?...
#import "CollectionViewController.h"
@interface CollectionViewController ()
@property (nonatomic, retain) NSMutableArray *items;
@end
@implementation CollectionViewController
@synthesize carousel;
@synthesize items;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)dealloc
{
carousel.delegate = nil;
carousel.dataSource = nil;
[items release];
[carousel release];
[super dealloc];
}
- (void)viewDidLoad
{
[super viewDidLoad];
carousel.type = iCarouselTypeCoverFlow2;
}
- (void)viewDidUnload
{
[super viewDidUnload];
self.carousel = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark -
#pragma mark iCarousel methods
- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
return [items count];
}
- (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel
{
return 29;
}
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
//create new view if no view is available for recycling
if (view == nil)
{
view = [NSArray arrayWithObjects:[UIImage imageNamed:@"gal1.jpg"],
[UIImage imageNamed:@"gal2.jpg"],
[UIImage imageNamed:@"gal3.jpg"],
[UIImage imageNamed:@"gal5.jpg"],
[UIImage imageNamed:@"gal6.jpg"],
[UIImage imageNamed:@"gal7.jpg"],
[UIImage imageNamed:@"gal8.jpg"],
[UIImage imageNamed:@"gal9.jpg"],
[UIImage imageNamed:@"gal10.jpg"],
[UIImage imageNamed:@"gal11.jpg"],
[UIImage imageNamed:@"gal12.jpg"],
[UIImage imageNamed:@"gal13.jpg"],
[UIImage imageNamed:@"gal14.jpg"],
[UIImage imageNamed:@"gal15.jpg"],
[UIImage imageNamed:@"gal16.jpg"],
[UIImage imageNamed:@"gal17.jpg"],
[UIImage imageNamed:@"gal18.jpg"],
[UIImage imageNamed:@"gal19.jpg"],
[UIImage imageNamed:@"gal20.jpg"],
[UIImage imageNamed:@"gal21.jpg"],
[UIImage imageNamed:@"gal22.jpg"],
[UIImage imageNamed:@"gal23.jpg"],
[UIImage imageNamed:@"gal24.jpg"],
[UIImage imageNamed:@"gal25.jpg"],
[UIImage imageNamed:@"gal26.jpg"],
[UIImage imageNamed:@"gal27.jpg"],
[UIImage imageNamed:@"gal28.jpg"],
}
else {
}
return view;
}
@end
while running on simulator i just get the screen not images?...i got stuck here....
© Stack Overflow or respective owner