I wrote this code and made 2 buttons, next and back, to display a picture in an NSMutubleArray using an UIImageView.
-(IBAction) pictureNext:(id)sender;
{
if (pictureIndice==[promMUAraay count])
{
pictureIndice=0;
}
NSLog(@"indice : %d ",pictureIndice);
Promotion *prom = [[Promotion alloc]init];
prom =[promMUAraay objectAtIndex:pictureIndice];
promotionPicture.image = [UIImage imageWithData:prom.pPicture];
//promLabel.text=prom.pName;
NSLog(@"label : %@",prom.pName);
pictureIndice++;
}
-(IBAction) pictureBack:(id)sender;
{
if (pictureIndice==[promMUAraay count])
{
pictureIndice=0;
}
NSLog(@"indice : %d ",pictureIndice);
Promotion *prom = [[Promotion alloc]init];
prom =[promMUAraay objectAtIndex:pictureIndice];
promotionPicture.image = [UIImage imageWithData:prom.pPicture];
//promLabel.text=prom.pName;
if (pictureIndice==0)
{
pictureIndice=[promMUAraay count];
}
pictureIndice--;
}
This works, but is it possible to make a little animation when changing image?