I have this code here:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[MMSideDrawerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
switch (indexPath.section) {
case MMDrawerSectionOne:
if(indexPath.row == 0){
[cell.textLabel setText:@"Menu Item 1"];
}
break;
case MMDrawerSectionTwo:
if(indexPath.row == 0){
[cell.textLabel setText:@"Menu Item 2"];
}
break;
case MMDrawerSectionThree:
if(indexPath.row == 0){
[cell.textLabel setText:@"Menu Item 3"];
}else{
[cell.textLabel setText:@"Menu Item 4"];
}
break;
}
cell.backgroundColor = [UIColor clearColor];
cell.textLabel.textColor = [UIColor whiteColor];
cell.contentView.alpha = 0.7;
// Code to add background when user taps
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor colorWithRed:(55.0/255.0) green:(55/255.0) blue:(55/255.0) alpha:0.3];
bgColorView.layer.masksToBounds = YES;
cell.selectedBackgroundView = bgColorView;
NSLog(@"%@", indexPath);
return cell;
}
and this code here:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"Testing");
}
Whenever I tap a row on the UITable didSelectRowAtIndexPath does nothing. Is there anything I am doing wrong?
Peter