如下日志输出所示,imageFile正确返回,但是image没有
这是segue的代码:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showBandPhoto"]) {
NSArray *indexPaths = [self.collectionView indexPathsForSelectedItems];
BDBPhotoViewController *destViewController = segue.destinationViewController;
NSIndexPath *indexPath = [indexPaths objectAtIndex:0];
PFObject *tempObject = [imageObjectsArray objectAtIndex:indexPath.row];
NSLog(@"object is %@", tempObject);
NSString *commentGet = [tempObject objectForKey:@"comment"];
destViewController.comment = commentGet;
PFFile *imageFile = [tempObject objectForKey:@"image"];
NSLog(@"ImageFile is %@", imageFile);
NSData *data = [imageFile getData];
UIImage *image = [[UIImage alloc] initWithData:data];
destViewController.bandImageName = image;
NSLog(@"image is %@", image);
这是日志输出:
object is Photos:RvKHQNYMtj:(null)
album = Promos;
comment = "Promo Pic 2011";
image = "PFFile: 0x16d901a0";
ipadImage = "PFFile: 0x16d88f40";
thumbnail = "PFFile: 0x16d9d360";
ImageFile is PFFile: 0x16d901a0
Warning: A long-running Parse operation is being executed on the main thread.
Break on warnParseOperationOnMainThread() to debug.
image is UIImage: 0x16ecfac0
comment is Promo Pic 2011
image is (null)
感谢您及时的回复。搜索了3个小时,然后发布,10分钟后我发现了我的错误。我没有正确保留财产。