Iphone 如何将图像url转换为EGO图像,并将该图像添加到一个可变数组中?

Iphone 如何将图像url转换为EGO图像,并将该图像添加到一个可变数组中?,iphone,ios,egoimageview,Iphone,Ios,Egoimageview,我正在获取JSON格式的图像url列表。现在我需要逐个解析图像url,并将其转换为EGOImage,然后将其添加到一个数组中,以便使用该图像执行动画。现在我得到的错误是图像是nil,无法添加到数组中 注意:图像url没有问题 我的JSON结构是 { "images":[ { "url":"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRQmkaIO86rYB-DctBr

我正在获取JSON格式的图像url列表。现在我需要逐个解析图像url,并将其转换为
EGOImage
,然后将其添加到一个数组中,以便使用该图像执行动画。现在我得到的错误是图像是
nil
,无法添加到数组中

注意:图像url没有问题

我的JSON结构是

{
 "images":[
               {
                 "url":"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRQmkaIO86rYB-DctBruyv4lFTEM-v_pGG9k5i0lrAr2Elzibvuiw"
               },
               {
                  "url":"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQGh1nRGgnbUZXgKLMKGdeT320PGttnLmbN4R-DxmckQpjVDhHS"
               }
          ]
}
我的代码:

NSMutableArray*arrForImageURL = [dic objectForKey:@"images"];
arrForUniqueWorderImages=[[NSMutableArray alloc]init];
for (NSDictionary*dictForImg in arrForImageURL)
{
   NSString*stringForImageURL=[dictForImg objectForKey:@"url"];
   imgView.imageURL=[NSURL URLWithString:stringForImageURL];
   [arrForUniqueWorderImages addObject:(EGOImageView*)imgView.image];
}

您正在尝试将EGOImageviews存储在数组中,因此必须首先正确初始化它。请尝试此操作

NSMutableArray*arrForImageURL = [dic objectForKey:@"images"];
arrForUniqueWorderImages=[[NSMutableArray alloc]init];
for (NSDictionary*dictForImg in arrForImageURL)
{
   EGOImageView *imageView = [[EGOImageView alloc] init];

   imageView.contentMode=UIViewContentModeScaleAspectFit;
   NSString*urlString=[dictForImg objectForKey:@"url"];
   NSURL *imageUrl=[NSURL URLWithString:urlString];
   imageView.imageURL =imageUrl;
   imageView.frame=CGRectMake(0,0,320,300);
   [arrForUniqueWorderImages addObject:imageView];
}

如何获取annimation的url,请添加代码以供参考。。。。