0

I have 3 controllers. I am using push and pop method to change the controllers.

[self.navigationController pushViewController:product_subcatagory animated:YES];
[self.navigationController popViewControllerAnimated:YES];

The issue I am getting while i am continue doing push and pop operation for 8 to 10 minutes as it responding slow animation and at one step is getting crashed. So what could be the reason for slow animation for push-pop controller operation.

Below as Example I have 3 class A,B,C. Then following push view controller and pop view controller operation i am performing.

A->B->C It has three possibilities 1. B->A 2.C->B->A 3.C->B

Thanks in Advance.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • 1
    If it eventually crashes then what's the crash reason? Solve that and you might solve the slowness. – Gruntcakes Jun 01 '15 at 20:58
  • Define "slow". Do you mean there is a delay before the normal animation occurs or do you mean the actual animation takes longer than it should? Have you verified you are doing all of the pushing and popping on the main thread? – rmaddy Jun 01 '15 at 21:24
  • Initially the controller push-pop navigation controller animation is working fine .But after few minute it getting slower and slower as i am keep doing push-pop operation.One more thing when aim moving to main controller (which is not A,B,C controller) then from main controller to A controller then agin A->B->C push-pop controller start working fine for few minute and getting slower and slower as i keep doing.So its cause of memory increases cause of object ? – Sanjeev Yadav Jun 01 '15 at 22:06

2 Answers2

0

Profile your app using Instruments. One possible reason is that your app is not releasing memory (due to retain cycles), and is slowing down and crashing because its memory usage keeps growing and growing.

0

I agree with Petah. Sounds like a memory issue. You might want to consider actually removing them temporary and calling them back as needed so they're not just sitting in the background using unneeded memory.

Andrew Cook
  • 116
  • 1
  • 8