0

First I have 3 ViewController. One as MainViewController. One as center view controller. One as left menu view controller. When I open application the center view show on front (not load left menu yet). The scrolling of tableview work smoothly.

But after I add left menu view controller as childViewController of main view controller (for event show left side menu). The scrolling of tableview in center view controller become lagging. What's the cause of this problem?

--- Solved ---

It's my fault this error is not related with childViewController. It's because adding effect to view layer of centerViewController.

[centerVC.layer setCornerRadius:CORNER_RADIUS];
[centerVC.layer setShadowColor:[UIColor blackColor].CGColor];
[centerVC.layer setShadowOpacity:0.8];
[centerVC.layer setShadowOffset:CGSizeMake(offset, offset)];

change these layer properties back while bring center view back to center is solved the problem.

---other inspect---

when reopen this view (first view is login view which is not complex ui) the table of centerVC back to scroll normal.

cpu and memory is normal both lag and not lag situation (cpu 0% when scrolling <10% ) (memory ~20MB for centerVC and become ~40MB when add leftVC)

user1047504
  • 578
  • 7
  • 14
  • add some code to get the idea – Suhit Patil May 28 '15 at 12:58
  • the centerVC table view scroll lag after [mainVC addChildViewController:leftVC]; [leftVC didMoveToParentViewController:newVC]; [mainVC.view addSubview:leftVC.view]; [mainVC.view sendSubviewToBack:leftVC.view]; – user1047504 May 28 '15 at 14:05

1 Answers1

0

Try multithreading if you are getting data from web service, also try lazy loading for images in tableView.

Vivek Deore
  • 71
  • 10
  • The center view already use asynchronous loading for data. The problem is I may do something wrong with adding or removing child view controller which make it lag. – user1047504 May 28 '15 at 11:43