Ios iPhone 6上没有显示图像

Ios iPhone 6上没有显示图像,ios,uitableview,uiimageview,parse-platform,Ios,Uitableview,Uiimageview,Parse Platform,所以我的图像是在iphone 5s上下载的,但它们没有出现在iphone 6的手机中。我正在使用parse.com,但我认为这不是一个解析问题。此外,在iPhone 5s上,当图像加载到手机中时,会导致滚动速度变慢,直到您通过图像时,图像才会加载。我知道这是因为我在重复使用电池,而且必须加载,但是有没有办法更快地加载图像,以便在你在电池中滚动到它之前显示出来?任何建议都很好。谢谢 - (UITableViewCell *)tableView:(UITableView *)tableView ce

所以我的图像是在iphone 5s上下载的,但它们没有出现在iphone 6的手机中。我正在使用parse.com,但我认为这不是一个解析问题。此外,在iPhone 5s上,当图像加载到手机中时,会导致滚动速度变慢,直到您通过图像时,图像才会加载。我知道这是因为我在重复使用电池,而且必须加载,但是有没有办法更快地加载图像,以便在你在电池中滚动到它之前显示出来?任何建议都很好。谢谢

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object{

NSString *cellIdentifier = @"activityT";

ActTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];

object = [self.objects objectAtIndex:indexPath.section];

NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
[dateformatter setTimeZone:[NSTimeZone systemTimeZone]];
[dateformatter setDateStyle:NSDateFormatterShortStyle];

NSString *name = [[[object objectForKey:@"fromUser"] objectForKey:@"username"]copy];
NSString *place = [[[object objectForKey:@"location"]objectForKey:@"placename"]copy];
NSString *city = [[[object objectForKey:@"location"]objectForKey:@"city"]copy];
NSString *state = [[[object objectForKey:@"location"]objectForKey:@"state"]copy];

cell.context.text = [object objectForKey:@"recommendationText"];

[[cell name]setTitle:[NSString stringWithFormat:@"@%@",name] forState:UIControlStateNormal];
[[cell placeButton]setTitle:[NSString stringWithFormat:@"%@ (%@,%@)",place,city,state] forState:UIControlStateNormal];

cell.time.text = [formatter stringForTimeIntervalFromDate:[NSDate date] toDate:[object createdAt]];


cell.myImage.image = nil;
cell.myImage.layer.cornerRadius = cell.myImage.frame.size.width / 2;
cell.myImage.clipsToBounds = YES;

cell.myImage.file = [[object objectForKey:@"fromUser" ]objectForKey:@"profileImage"];
[cell.myImage loadInBackground];

cell.layer.cornerRadius = 5;
cell.layer.masksToBounds = YES;



cell.placeImage.image = nil;
cell.placeImage.clipsToBounds = YES;

if ([object objectForKey:@"postImage"]) {

    cell.placeImage.file = [object objectForKey:@"postImage"];

    if ([cell.placeImage.file isDataAvailable]) {

[cell.placeImage loadInBackground:^(UIImage *image, NSError *error) {
    if (!error) {

    CGSize size = CGSizeMake(cell.placeImage.frame.size.width, 200);
    cell.eventImage.image = [self imageWithImage:image scaledToSize:size];


    }

}];
    }

}


return cell;
}

{


}

是“placeImage”没有显示吗?是的。另一个正在显示,但那是因为它是固定的缩略图大小。我正在缩小位置图像的大小以获得最佳质量。我能搞定你知道Lyndsey怎么了吗?哦。。。几天前,当你发布这篇文章时,我一定有一个理论,知道你的意思是“placeImage”。。。我得再看一遍。。。(你需要标记一个用户,以便在你回复自己问题下方的评论时通知他们。)但是,作为一个例子,你绝对不应该像那样动态缩放图像。在一个上下文中画图需要花费太多的时间和内存,这样在滚动时才能快速完成。为什么“eventImage”和“placeImage”都包含相同的图像?哪一个没有出现?还是两个人都没来?
- (UIImage*)imageWithImage:(UIImage*)image
          scaledToSize:(CGSize)newSize;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(newSize.width, newSize.height), NO, 0);
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];

UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return newImage;