I've encountered a problem in assignment4,here is my code
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
if ([segue.identifier isEqualToString:@"Show Detail"])
{
UITableViewCell *newCell = [self.tableView
cellForRowAtIndexPath:indexPath];//get a new cell
NSURL * photoURL = [FlickrFetcher urlForPhoto:
[self.photoList objectAtIndex:indexPath.row]
format:FlickrPhotoFormatLarge];
NSData *imageData = [NSData dataWithContentsOfURL:photoURL];
UIImage *img = [[UIImage alloc] initWithData:imageData];
[segue.destinationViewController setImage:img];
[segue.destinationViewController
setTitle:newCell.textLabel.text];
newCell.accessoryView = nil;
}
}
in the PhotoOfPlacesTableViewController,when I press on a cell and it
segue to a UIScrollView to show image,but now the problem is that it
just black out when I segue to the ShowPhotoViewController(where the
UIScrollView embedded in),here is the result:
http://www.flickr.com/photos/77324738@N08/6789238046/
I have two outlets (image view and scrollView) and one public property
(image) in ShowPhotoViewController,in order to show the image,I
put self.imageView.image = self.image; in ViewDidLoad. still can't
work.seek help!!!!!!!!!!!!!!!!!!!!!!!!thanks a lot!!