0

I have a scrollview and table view in one screen. Both of them contain heavy data as its a trading app. So every second I receive and update in the value and call cell update. Meanwhile if the user tries scrolling the scrollview,it doesnt respond, though the scroll delegates are called. Any help will be appreciated. Thanks

B.V.
  • 73
  • 8
  • The only thing I can say about this issue is, don't block the main thread. – Kazuki Sakamoto Jun 05 '15 at 20:35
  • True.But in this case since everything is a UI update, I cant help but need to have everything on main thread.I basically want to prioritize the touch event over any other UI activity. Is there a way to flush out all the queued operation in main_queue when a touch event is encountered ? – B.V. Jun 08 '15 at 06:41

1 Answers1

0

You should try to investigate two things:

  1. When you say you have a table view and a scroll view, I hope you are not putting your table view inside a scroll view, and increasing the content height of scroll view and table view. If you do this, you will be making multiple cells, and loading all the cells in memory. This technique doesn't go well with dequeueReusableCellWithReuseIdentifier.

  2. Only do the UI update on main queue, calling and receiving data should not be done on main queue.

I suspect that you may be doing something wrong in point 1. How many cells would you show at one time on an iPhone/iPad screen, max 10-15 cells. If you reuse cells and have 10-15 cells in memory, your app won't go slow.

swapnilagarwal
  • 1,126
  • 8
  • 16
  • No I am not doing that. So there are two sections of my app. One has tableview and the other is scrollview. These both sections are not related.And also the data is being downloaded in a seperate thread. But while updating the cell I need to be on the main thread.And this updation is very frequent. Thats the reason the touch event is not very smooth I guess. – B.V. Jun 08 '15 at 12:08
  • Can you send a screenshot of your app ? – swapnilagarwal Jun 09 '15 at 08:09