samedi 7 février 2015

How to Pass Multiple images to other View at a time?


Vote count:

0




In my app I'm picking five images at a time and displaying in a small view and I have button if I click that button the 5 images in that view should go to next View Controller .but when I'm clicking that button only the image in 0th index is passing and remaining images are not passing.Hope someone helps me


And here is my code.This code is for passing from first view to second view and chosenImages is an array where all the picked images are saving



SecondViewController *secview=[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
if (secview.imgView.tag==0) {
secview.img=[self.chosenImages objectAtIndex:0];
}
else if (secview.imgView1.tag==1)
{
secview.img=[self.chosenImages objectAtIndex:1];

}
else if (secview.imgView1.tag==2)
{
secview.img=[self.chosenImages objectAtIndex:2];

}
else if (secview.imgView1.tag==3)
{
secview.img=[self.chosenImages objectAtIndex:3];

}
else if (secview.imgView1.tag==4)
{
secview.img=[self.chosenImages objectAtIndex:4];

}
NSLog(@"%@",secview.img);
[self presentViewController:secview animated:YES completion:nil];


and in second view my code is:



if (imgView.tag==0)
{
imgView.image=img;
}
else if (imgView1.tag==1)
{
imgView1.image=img;
}
else if (imgView2.tag==2)
{
imgView2.image=img;
}
else if (imgView3.tag==3)
{
imgView3.image=img;
}
else if (imgView4.tag==4)
{
imgView4.image=img;
}


asked 51 secs ago







How to Pass Multiple images to other View at a time?

Aucun commentaire:

Enregistrer un commentaire