我可以让它与 xib 一起使用,但是如何使用 Storyboards 实现相同的效果?我相信我需要使用 prepareForSegue,但不知道如何实现它。这是我的代码:
- (void)buttonTouched:(id)sender {
// When picture is touched, open a viewcontroller with the image
PFObject *theObject = (PFObject *)[allImages objectAtIndex:[sender tag]];
PFFile *theImage = [theObject objectForKey:@"imageFile"];
NSData *imageData;
imageData = [theImage getData];
UIImage *selectedPhoto = [UIImage imageWithData:imageData];
PhotoDetailViewController *pdvc = [[PhotoDetailViewController alloc] init];
pdvc.selectedImage = selectedPhoto;
[self presentModalViewController:pdvc animated:YES];
}