Reputation: 29
I created a custom class for super UICollectionViewCell. Now when I call
MyCollectionViewCell *itemView = [self.collectionView cellForItemAtIndexPath:indexPath];
I get a warning:
"Pointers types do not match",(cellForItemAtIndexPath:indexPath] returns UICollectionView cell ).
How do I fix it?
Upvotes: 1
Views: 244
Reputation: 651
The warning is because cellForItemAtIndexPath returns a UICollecitonViewCell. you have to cast it as a MyCollectionViewCell such as:
MyCollectionViewCell *itemView = (MyCollectionViewCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
This should take care of the warning.
Upvotes: 4