ios - not getting all images when passing images data to imageview -
i parsing xml image urls imageview
in detailviewcontroller
passed images through shareddelegate
.but when click on tableviewcell
few images occure in detailviewcontroller
.
imageview.image = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:shareddelegate.imagobj]]];
the above code wrote in detailviewcontroller
appdelegate *shareddelegate = (appdelegate*)[[uiapplication sharedapplication]delegate]; shareddelegate.imagobj = [imagesarray objectatindex:indexpath.row];
i wrote code in tableview didselectrow
method.
you can create image property in detailviewcontroller
and tableview didselectrowatindexpath method. call segue
[self performseguewithidentifier:@"detailsegue" sender:indexpath];
and set
- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"detailsegue"]) { detailviewcontroller *dc = (detailviewcontroller *)[segue destinationviewcontroller]; dc.image = [imagesarray objectatindex:sender.row]; } }
Comments
Post a Comment