指定的时间之后执行跳转:
double delayInSeconds = 3.0;//添加成功之后,返回客户列表页
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSArray *temArray = self.navigationController.viewControllers;
for(UIViewController *temVC in temArray)
{
if ([temVC isKindOfClass:[SHNewClientListViewController class]])
{
[self.navigationController popToViewController:temVC animated:YES];
}
}
});
NSArray *temArray = self.navigationController.viewControllers;
for(UIViewController *temVC in temArray)
{
if ([temVC isKindOfClass:[xxxVC Class]])
{
[self.navigationController popToViewController:temVC animated:YES];
}
}