0

我在 Amazon S3 服务上有两张图片。一个加载正常,另一个不加载。没有错误消息。它只是不加载。

[doodleImageView setImageWithURL:@"https://s3.amazonaws.com/doodlestash/doodles/20/thumb.jpg"];

 //This one does not load.
[doodleImageView setImageWithURL:@"https://s3.amazonaws.com/doodlestash/doodles/20/original.jpg"];

有什么想法吗?

4

1 回答 1

1

图像确实看起来都是“有效的”。您可能需要仔细检查您正在使用的库并检查拼写错误。在一个快速演示应用程序中,我执行了以下操作:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    UIImageView* image1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 200)];
    image1.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://s3.amazonaws.com/doodlestash/doodles/20/original.jpg"]]];

    UIImageView* image2 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 200, 320, 200)];
    image2.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://s3.amazonaws.com/doodlestash/doodles/20/thumb.jpg"]]];

    [self.view addSubview:image1];
    [self.view addSubview:image2];
}

我最终得到了这个:

在此处输入图像描述

于 2013-01-30T01:44:33.723 回答