-(void)setSlowlyClose{
//下面设置延迟执行,否则太快看不到提示信息
double
delayInSeconds
= 2.0;
dispatch_time_t
popTime
= dispatch_time(DISPATCH_TIME_NOW,
delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime,
dispatch_get_main_queue(),
^(void){
dispatch_async(dispatch_get_main_queue(),
^{
NSArray
*arr
= self.navigationController.viewControllers;
if
(arr
!= nil
&&
arr.count
>=
3)
{
UIViewController
*vc =
[arr objectAtIndex:(arr.count-3)];
[self.navigationController
popToViewController:vc
animated:YES];
}
else
{
[self.navigationController
popViewControllerAnimated:TRUE];
}
});
});
}