Alex Rivera | Logout

UICollectionView delegate's tap method not getting called

Asked 2013-07-17T12:58:26.737
26

I have a collection view, the datasource delegate works well, but UICollectionViewDelegate:

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"didselect");
}

not get called, although i set the delegate (as i did with data source and it worked) I have to mention that my cell is loaded from a nib and is connected to a subclass of UICollectionViewCell, anyway the cells do not respond to my touch. I enabled the user interaction in the UIImageView that is in my cell.

also :

-(BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"this is caled");
    return YES;
}

is not getting called!

as I mentioned I did set:

[self.collectionView setDelegate:self];

and of course

<UICollectionViewDelegate>

also I don't have any touchBegan override ..

UPDATE:

WEIRD! it only gets called if I long press! how can I fix this, I set delaysContentTouches to NO plus i don`t have any gesture recognizers implemented.

help please. thanks.

Edit
Report

1 Answer

1

I had a similar issue with PSUICollectionView (this works on iOS5 too) and I fixed it by putting a button on my CollectionViewCell and setting the target of that button Also add tag's to know which button is pressed.

answered 2013-07-17T13:33:13.240

Your Answer