static NSString *cellIdentifier = @"Cell";
AssignmentTableCell *cell = (AssignmentTableCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AssignmentTableCell" owner:self options:Nil];
cell = [nib objectAtIndex:0];
}
Here is my Code for custom Cell initialization. I am detecting uitouch for custom cells and then i am pushing view controller rather than using DidSelected Event of the UItableView. But problem i am facing is
I can select 2 rows at a time, which is not my intension and that leads to application crash. I have tried to disable multitouch but of no use. they still keep selecting 2 cells at a time.
Any Help will be appreciated.
Edit 1:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
imgBg.image = [UIImage imageNamed:@"rowSelected.png"];
[[self delegate] touchStarted:tag];
}
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
imgBg.image = [UIImage imageNamed:@"7CustomCellBackground.png"];
[[self delegate] touchEnded:tag];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//imgBg.image = [UIImage imageNamed:@"7CustomCellBackground.png"];
[[self delegate] rowTocuchedFromClicked:tag];
}
Here are the touches method of the cell.