0

So I have to work on this really big project, it's still on objective C.

I was just ask to make a really small change (hide a button) so I did that and it's building fine and everything looks normal but then all of the tableView in the project won't react as in didSelectRowAtIndexPath is never called (scrolling work and the data are correctly displayed)

The only thing that changed compared to before is that I used xCode 9.

Now when I build it using xCode 8 it's working again so at least we can go ahead but I still am wondering what is happening.

I made a smaller project using exactly the same logic as the main project (the cell are custom, you can swipe etc) and when I did it from scratch, it's working fine.

So I fell like it's more of an xCode bug/error than one with the code. would someone have any idea ?

Neodigi
  • 193
  • 4
  • 19
  • make your you have single selection is set on tableview on storyboard file – Prashant Tukadiya Dec 04 '17 at 08:22
  • There can be a possibility that the Outlet for the Delegate is not getting connected to the viewController in storyboard on XCode 9, Just try to remove the delegate and attach again on the new xcode, or try to set the delegate programatically, – Bonnie Dec 04 '17 at 08:23
  • @JonSnow Single selection is indeed correctly set – Neodigi Dec 04 '17 at 08:27
  • @Bonnie i've tried both approach, didn't work ;( – Neodigi Dec 04 '17 at 08:27
  • @Néodigi And Please confirm that it is `didSelectRowAtIndexPath` not `didDeSelectRowAtIndexPath` – Prashant Tukadiya Dec 04 '17 at 08:29
  • @Néodigi As well as other delegate are called or not like height for row ? – Prashant Tukadiya Dec 04 '17 at 08:29
  • @JonSnow Confirming, its the correct method – Neodigi Dec 04 '17 at 08:29
  • @JonSnow just tried to be sure, but yes heightForRowAtIndexPath is correctly called – Neodigi Dec 04 '17 at 08:33
  • @Néodigi Do you have any gesture added ? in that screen – Prashant Tukadiya Dec 04 '17 at 08:35
  • @Néodigi Could you please add snapshot of your view ? Possible that your buttons on tableview cell conflicting action with didSelectRowAction – Prashant Tukadiya Dec 04 '17 at 08:36
  • @JonSnow i dont have any gesture but just in case I added cancelsTouchesInView in most please to see if that made a difference and it didn't. Im not sure i would have to ask my PM and they already went back, so not immediatly at least – Neodigi Dec 04 '17 at 08:38
  • It's too hard to predict the problem without taking a look to your code and layout. Are you sure that the only difference is the Xcode version? – Dorukhan Arslan Dec 04 '17 at 09:04
  • can you tell me about hide button?Means it's functionality? – Mangesh Murhe Dec 04 '17 at 09:52
  • @Néodigi, Im facing the same problem when migrated very old objective c code to Xcode 9. It is still working perfectly fine in xcode8 but not working with xcode9. In my case even cell is not at all visible when I open using Xcode9. Please let me know if you get any work around for your issue. that can give me some hint at least. Thanks! – torap Feb 21 '18 at 18:27

2 Answers2

1

Have you used tap anywhere on that UI?? because when tap: UITapGestureRecognizer is there in UI didselect work after only at longpress of cell

or you can just set in your viewdidload function

UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
[self.tableView addGestureRecognizer:gestureRecognizer];
gestureRecognizer.cancelsTouchesInView = NO; 
0

Please check the following

enter image description here It should be single selection

enter image description here It should be interaction enabled

And check you have created any button on top of all layers which is targeting some other action.

Check it and reply.

  • Single selection and interaction enabled are correctly set. There is a button on top on the uiTableView at the bottom (similar to a fab) But I don't think that's it since it's not reacting unless I really click on it – Neodigi Dec 04 '17 at 08:30
  • Comment the button code and check once, or check the button click action style is correctly set as touch up inside. – ARULMOORTHY C Dec 04 '17 at 09:29