- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{
    if (tableView == sessionListTable){
        selectedSessionId = [[self.sessionNames objectAtIndex:indexPath.row] objectForKey:@"session_id"];
        selectedSessionName = [[self.sessionNames objectAtIndex:indexPath.row] objectForKey:@"session_name"];
        NSLog(@"%@",selectedSessionId);
        [StudentCommon sharedInstance].mTeacherSessionId = selectedSessionId;
        [self remoteSessionButtonClick];
        currentIndexPath = indexPath;
        previousIndexPath = currentIndexPath;
        [sessionListTable reloadData];
        [sessionListPopUp removeFromSuperview];
    }

TheUILabel` inside table view is not responding to touch, though the touch is working only in Empty space of the cell.

Verified all the connections, constraints and classes.

2 Answers

0
Sanket Shriwastwa On
  • Check all the properties of inside UI elements in Attribute Inspector,
  • make sure for all of them are user interaction is “Ticked”  ☑️
  • Check the properties inside User Defined Runtime Attributes and remove which are not required.
  • Check the Class name whether it’s the correct “Super Class” / “Relevant Custom
 Class” or not.
  • Check inside Connections Inspector whether the connection is having any warning ⚠️, if warning exists remove connection and connect again.

This is the image showing the User Defined Runtime Attributes, which was causing this error

0
user2869341 On

First you should know that UILabel doesn't respond to TouchUpInside event. Apart from that, the events those are raised in UITableViewCell, is not catchable in superview (i.e UITableViewController or UIViewController that is hosting respective table).

In order to achieve your goal, you need to change your UILabel to a UIButton. And in order to escalate TouchUpInside event to super view, you have two options: 1- Create a delegate for your cell, and utilise it in your superview. 2- Post a notification from your cell, and observe (catch) it in super view.

Good Luck. :-)