1

I have several UITableView, UIScrollViews in my app. The tableview and scrollview scrolls smoothly on initial loading. But after the continuous usage of the app for some 7-10 minutes the scrolling really hacks. I implemented lazy loading for UITableView. I have also a NSTimer running in the background for polling.

NSRunLoop *runloop = [NSRunLoop currentRunLoop];
pollTimer = [NSTimer timerWithTimeInterval:4 target:self selector:@selector(threadStarter) userInfo:nil repeats:YES];
[runloop addTimer:pollTimer forMode:NSRunLoopCommonModes];

Is this the reason for the stuck in the scrolling of UITableViews.

How can i solve this issue?

Priyanka V
  • 834
  • 2
  • 12
  • 34
  • i thought mainly reason of looping of timer after ever 4 second your table Data will be reload that's why your scroll hacks.. may be.. please visit this quiestion :-http://stackoverflow.com/questions/8787014/nstimer-sometimes-freezes-when-app-is-doing-heavy-computation – Nitin Gohel Nov 05 '12 at 07:38
  • also visit this link:http://stackoverflow.com/questions/10862066/nstimer-is-pausing-a-while-when-uigesture-action-performed – Nitin Gohel Nov 05 '12 at 07:44
  • Do you have any statistics of the `-threadStarter` performance ? – A-Live Nov 05 '12 at 07:50
  • Polling is not for refreshing tableview. Its looking for any new updates from server @NitinGohel – Priyanka V Nov 05 '12 at 08:36

1 Answers1

1

The one main reason for these kind of issues that cause the apps to respond slower over time is "Memory Leaks".

Check if you are releasing the cells and its contents properly. Please refer this post to know how to debug memory leaks, if you are new to this.

EmptyStack
  • 51,274
  • 23
  • 147
  • 178
  • I will check for memory leaks. But if its an issue with memory it will show memory warning while debugging or it will crash at some point, right. But here i never got a crash on my application due to memory leak – Priyanka V Nov 05 '12 at 10:23