Sometimes there is delay between viewWillAppear and viewDidAppear, no CPU usage

920 views Asked by At

I have a segue defined in storyboard from a table cell to a view controller using Modal

There are 20% of chance that the lag between viewWillAppear and viewDidAppear will be extreme long (above 5 seconds), 80% of time the lag is within 1 second.

This happens even there is no code in viewDidload and viewWillAppear in the view controller.

But if I set the segue to "animation disabled", the lag get removed.

I have some other segue triggered from button in the same form and they works fine.

When it lags, there is no CPU load and the xcode is waiting for message (mach_msg_trap).

Here is the log, you can see the last segue takes 14.5 seconds.

2014-01-05 00:38:10.634 ATracker[29792:70b] ViewWillAppear finshed
2014-01-05 00:38:11.179 ATracker[29792:70b] ViewDidAppear started
2014-01-05 00:38:15.080 ATracker[29792:70b] ViewWillAppear finshed
2014-01-05 00:38:15.922 ATracker[29792:70b] ViewDidAppear started
2014-01-05 00:38:17.138 ATracker[29792:70b] ViewWillAppear finshed
2014-01-05 00:38:17.969 ATracker[29792:70b] ViewDidAppear started
2014-01-05 00:38:21.041 ATracker[29792:70b] ViewWillAppear finshed
2014-01-05 00:38:35.540 ATracker[29792:70b] ViewDidAppear started

Anyone has the same problem and how you fixed it?

Thanks!

0

There are 0 answers