0

我正在尝试将一些图像保存到一个数组中,并将它们的名称作为字符串保存到另一个数组中,代码如下;

self.countryNamesArray.append(object["CountryName"] as! String)
let image = UIImage(data:imageData!)
self.countryImages.append(image!)

但它不会以我保存的相同顺序检索图像,同时以正确的顺序检索 CountryNamesArray。

rowString = countryNamesArray[row]
myImageView.image = self.countryImages[row]

我应该使用自定义类来保存带有字符串的图像还是有什么方法可以解决?

4

0 回答 0