0

This question has been asked here in a slightly different form, but the question has not been addressed in this thread, hence this thread.

In my iPad application, I allow the user to select a number of cells in a table view. After the user has tapped a button, a process begins and the user is not allowed to interact with the table view at that point (rest assured, the user can still interact with the application).

To accomplish this, I thought the "userInteractionEnabled" property of the UITableView was the answer, but in spite of setting this property to NO (and checking that it is indeed set to NO), the user can still interact with the table view.

I also tried the same approach in a fresh Xcode template project and that works fine. Am I missing something essential?

Community
  • 1
  • 1
Bart Jacobs
  • 9,022
  • 7
  • 47
  • 88

2 Answers2

1

I am not sure why setting the property userInteractionEnabled to NO is not working, but I found a workaround by setting scrollEnabled to NO and allowsSelection to NO. This result in a similar effect that mimics what I am looking for.

Bart Jacobs
  • 9,022
  • 7
  • 47
  • 88
0

I believe you're seeing this because user is interacting with table cells, not the table itself. Try using [[UIApplication sharedApplication] beginIgnoringInteractionEvents] when beginning the operation and appropriately calling [[UIApplication sharedApplication] endIgnoringInteractionEvents] AFTER operation has completed.

Eimantas
  • 48,927
  • 17
  • 132
  • 168
  • Thanks for the feedback. I have read this elsewhere as well, but doesn't this prevent all interaction with the application (which is not what I intend)? Also, I would assume that if userInteractionEnabled is set to NO for the table view that scrolling the table view would also be disabled. This is not the case. – Bart Jacobs Dec 06 '10 at 18:27
  • The scrolling is enabled by scroll view which encapsulates the tableview. – Eimantas Dec 06 '10 at 19:14
  • Not to question your expertise or to start a discussion, but UITableView is a subclass of UIScrollView. If userInteractionEnabled is set to NO then the table view shouldn't respond to any input of the user in my opinion. That's what happens if I test this in a fresh Xcode template, but for some reason this does not happen in my application. Odd. Thanks for your input. – Bart Jacobs Dec 06 '10 at 20:45