【iOS】在一个object.m里定义了一个viewcontroller,whose view is not in the window hierarchy!

问题:在一个object.m里定义了一个viewcontroller(currentViewController),到一个地方报错 on whose view is not in the window hierarchy!

还在无限的循环这个,可是还没到UIAlertView,只是之前使用了MBProgressHUD ,可是设置断点也通过了这个MBProgressHUD。

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.currentViewController.navigationController.view animated:YES];

hud.mode = MBProgressHUDModeIndeterminate;

hud.dimBackground = YES;

hud.labelText = @"正在登录..";

//断点没有到下面这一步,就在循环报错

[temVC.netManager POST:url parameters:encryParams success:^(AFHTTPRequestOperation *operation, id responseObject) {
.......
}

不知道是那里出错了,请路过的大佬们帮忙看看~

检查下当前控制器的导航栏是否存在,断点打印下navigation的值看看是否为空