0
我一直沒有編程很長時間,我正嘗試使用Parse.com創建一個簡單的圖庫,我遵循本教程https://www.parse.com/tutorials/saving-images,但使用故事板而不是nibs。Parse.com圖像庫開放圖像詳細視圖
我設法讓它的大部分工作,但我堅持在最後一關,當涉及到在新的視圖中打開選定的圖像全尺寸。 下面給出了圍繞網絡的其他答案我試圖將圖像傳遞給- (void)prepareForSegue:
中的詳細視圖,但我仍然沒有運氣。
我在ViewController.h代碼目前看起來像這樣
- (void)buttonTouched:(id)sender {
PFObject *theObject = (PFObject *)[allImages objectAtIndex:[sender tag]];
PFFile *theImage = [theObject objectForKey:@"imageFile"];
NSData *imageData;
imageData = [theImage getData];
selectedPhoto = [UIImage imageWithData:imageData];
[self performSegueWithIdentifier:@"goGo" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([[segue identifier] isEqualToString:@"goGo"]) {
PhotoDetailViewController *pdvc = [[PhotoDetailViewController alloc] init];
pdvc.selectedImage = selectedPhoto;
}
}
和DetailViewController.h
- (void)setDetailImage {
self.photoImageView.image = selectedImage;
}
當談到這個將加載圖像視圖中打開空白的,任何幫助是一個巨大的幫助。如果它更容易,我可以上傳該項目。
由於提前, 克里斯
謝謝您更換
! :)一旦有人向你指出,這似乎很明顯,這是我的猜測! –