zoukankan      html  css  js  c++  java
  • 日志报错Can't add self as subview

    #pragma mark- add 20151112 导航动画时间太短导致崩溃,重写UINavigationcontroller以下相关方法

    - (id)navigationLock; ///< Obtain "lock" for pushing onto the navigation controller

    - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated navigationLock:(id)navigationLock; ///< Uses a horizontal slide transition. Has no effect if the view controller is already in the stack. Has no effect if navigationLock is not the current lock.

    - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated navigationLock:(id)navigationLock; ///< Pops view controllers until the one specified is on top. Returns the popped controllers. Has no effect if navigationLock is not the current lock.

    - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated navigationLock:(id)navigationLock; ///< Pops until there's only a single view controller left on the stack. Returns the popped controllers. Has no effect if navigationLock is not the current lock.

     .m文件

    #pragma mark- add 20151112 导航动画时间太短导致崩溃,重写以下相关方法

    - (id)navigationLock

    {

        return self.topViewController;

    }

    - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated navigationLock:(id)navigationLock

    {

        if (!navigationLock || self.topViewController == navigationLock)

            [self pushViewController:viewController animated:animated];

    }

    - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated navigationLock:(id)navigationLock

    {

        if (!navigationLock || self.topViewController == navigationLock)

            return [self popToRootViewControllerAnimated:animated];

        return @[];

    }

    - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated navigationLock:(id)navigationLock

    {

        if (!navigationLock || self.topViewController == navigationLock)

            return [self popToViewController:viewController animated:animated];

        return @[];

    }

  • 相关阅读:
    Js 内存泄露追踪
    [导入]关于在ashx页面中使用Session的问题
    [导入]通过SQL语句删除重复记录
    javascript也玩pageLoad
    判断是否首次触发pageLoad 与 PageRequestManager.getInstance()对象的几个事件触发顺序
    ASP.NET Web下基于Forms的验证
    [导入]用程序来还原数据库(一个遗留了两年的问题)
    [导入]自己编写QQ挂机软件基于HTTP的QQ协议之我所见
    iis 中后台调用exe文件
    ORA12154: TNS:could not resolve the connect identifier spec
  • 原文地址:https://www.cnblogs.com/niexiaobo/p/5012043.html
Copyright © 2011-2022 走看看