在UICollectionView中,每个不同的UICollectionViewCell对象通常具有不同的地址。如果你发现不同的UICollectionViewCell对象具有相同的地址,这可能是由于以下原因之一:
// 注册不同类型的UICollectionViewCell
collectionView.register(UINib(nibName: "CustomCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "CustomCollectionViewCellIdentifier")
collectionView.register(UINib(nibName: "AnotherCustomCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "AnotherCustomCollectionViewCellIdentifier")
// 获取自定义的UICollectionViewCell
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCollectionViewCellIdentifier", for: indexPath) as! CustomCollectionViewCell
如果以上两个解决方法都没有解决你的问题,那么可能是其他代码逻辑导致了UICollectionViewCell具有相同的地址。在这种情况下,你需要仔细检查你的代码逻辑,查找可能导致这个问题的原因。