Detect second tap on tableview cell iphone sdk

Posted by neha on Stack Overflow See other posts from Stack Overflow or by neha
Published on 2010-05-11T09:28:42Z Indexed on 2010/05/11 9:34 UTC
Read the original article Hit count: 294

Hi all,

In my application, I'm expanding a tableview row when it's tapped. I'm using

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

[super setSelected:selected animated:animated];
if( selected == YES ) {
    [self expandRow];
}
else {
    [self contractRow];
}

height = [lblFeed frame].size.height + 75;

}

to achieve that.

So when a row is tapped, this function automatically gets the signal of row tap and it sets the selected=YES.

Now when I tap the same expanded row, it still sets selected=YES. I want to detect the second tap and contract the row. How shall I do that while using the same function?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk