views:

23

answers:

1

hi guys , i asked this question yesterday but it doesnt seem to have asked properly so im trying again

in my app im parsing in an xml file , in that file there is a path for an image to download

an in my tableview controler i have this to download the image and display it in the cell

NSURL *url = [NSURL URLWithString:aStory.picture];
 NSData *data = [NSData dataWithContentsOfURL:url];
 UIImage *img = [[UIImage alloc] initWithData:data];

im then pushing another view controller on the top and displaying some text in a text view , but i also want to take the image from the cell selected and put that in there too , but everything i try does not work.

any ideas on how i can do this

Thanks in advance Richard

A: 

You need to create a property in the target ViewController to hold the image

UIImage *myDownloadedImage;
}

@property (nonatomic, assign) UIImage *myDownloadedImage;

and then when you are about to push you add the image to the controller

myNextViewController.myDownloadedImage = img;
[self.navigationController pushViewController:myNextViewController animated:YES];

Now you have access to the image to do as you wish

Liam
thanks for that :)
richard Stephenson