Search code examples
iosios7xcode5uistoryboardsegue

how to pass the image using storyboard in ios7


I cant able to pass the image from 1 view to another view in ios7.

in current view

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {
BehindContributors *destViewController = segue.destinationViewController;
[destViewController setImage:@"1.jpg"];
}

in destination view

    self.image1.image=self.image;

Solution

  • did you try imageNamed method on ÙIImage

    like so;

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
       if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {
          BehindContributors *destViewController = segue.destinationViewController;
       [destViewController setImage:[UIImage imageNamed:@"1.jpg"]];
    }