wait_fences: failed to receive reply: 10004003 的疑惑
废话不说,先上代码:
1 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 2 { 3 switch (buttonIndex) { 4 case 0:{ 5 // 进入搜索页面查询适合岗位。 6 [self.navigationController popToRootViewControllerAnimated:NO]; 7 AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; 8 UITabBarController *tabbarController = [appDelegate tabbarController]; 9 [tabbarController setSelectedIndex:1]; 10 } 11 break; 12 case 1:{ 13 [self.navigationController popToRootViewControllerAnimated:YES]; 14 } 15 break; 16 default: 17 break; 18 } 19 }
过程是这样的:在弹出的alter中点击按钮(index==0)会先将目前的navController pop 到根视图控制器,然后通过tabbarController切换到另外一个选项卡中。结果就遇到了wait_fences: failed to receive reply: 10004003 的警告,虽然程序不会crash,但是会有明显的延迟。
如果只是navController的pop方法,无论 Animated 是否开启都是没有问题的,只是加上tabbarController的选项卡切换后就会出现wait_fences: failed to receive reply: 10004003 的警告。
经过网上问题的搜索,初步判断可能是因为在运行 clickedButtonAtIndex 方法时,alterview还没有完成dismiss动画过程(或者还根本没有开始),这时进行页面切换导致上面的问题,于是换用 didDismissWithButtonIndex 方法发现问题解决了(不过是在alterview dismiss动画完成之后页面才切换的)。
虽然问题解决了,但是还是不太清楚究竟根源错在哪里。。。等待大神指教。
浙公网安备 33010602011771号