如何移除导航栏中的控制器?

BOOL changed = NO;
NSMutableArray* viewControllers = [self.navigationController.viewControllers mutableCopy];
for (NSInteger i = 0; i < viewControllers.count; i++) {
        if([viewControllers[i] isMemberOfClass:[GoldCoinTaskViewController class]]) {
            [viewControllers removeObjectAtIndex:i];
            changed = YES;
        }
 }
 if(changed) {
        [self.navigationController setViewControllers:viewControllers animated:NO];
 }

推荐阅读更多精彩内容