zoukankan      html  css  js  c++  java
  • IOS 7 Study

    Problem
    You would like to directly manipulate the array of view controllers associated with a
    specific navigation controller


    Solution
    Use the viewControllers property of the UINavigationController class to access and
    modify the array of view controllers associated with a navigation controller

    - (void) goBack {
        /* Get the current array of View Controllers */
        NSArray *currentControllers = self.navigationController.viewControllers;
    
        /* Create a mutable array out of this array */
        NSMutableArray *newControllers = [NSMutableArray
                                          arrayWithArray:currentControllers];
    
        /* Remove the last object from the array */
        [newControllers removeLastObject];
    
        /* Assign this array to the Navigation Controller with animation */
        [self.navigationController setViewControllers:newControllers
            animated:YES];
    }
  • 相关阅读:
    【arc068E】Snuke Line
    Subseq
    【agc004F】Namori
    Yura
    【agc008F】Black Radius
    【arc080F】Prime Flip
    【arc075F】Mirrored
    【arc074E】RGB Sequence
    【bzoj3669】魔法森林
    【bzoj2500】幸福的道路
  • 原文地址:https://www.cnblogs.com/davidgu/p/3557309.html
Copyright © 2011-2022 走看看