【问题标题】:Warning unable to restore previous frame and giving error: EXC_BAD_ACCESS警告无法恢复上一帧并给出错误:EXC_BAD_ACCESS
【发布时间】:2012-03-27 23:56:31
【问题描述】:

我的 iPhone 应用程序崩溃并给出以下警告

warning: Unable to restore previously selected frame.
Current language:  auto; currently objective-c
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.

这是实际崩溃的代码

+(id) tbxmlWithURL:(NSURL*)aURL;{
    return [[TBXML alloc] initWithURL:aURL];
}


-(id)initWithURL:(NSURL*)aURL{
    return [self initWithURL:aURL];
}

【问题讨论】:

    标签: iphone objective-c tbxml yahoo-weather-api


    【解决方案1】:

    您的-initWithURL: 方法正在递归调用自身。每次这样做时,它都会添加一个堆栈帧,最终您会用完堆栈空间并崩溃。发生这种情况时,调试器通常不会为您提供太多有用的信息。

    你是这个意思吗?

    -(id)initWithURL:(NSURL*)aURL{
        return [super initWithURL:aURL];
    }
    

    【讨论】:

    • 没错。它解决了我的问题
    猜你喜欢
    • 2011-02-27
    • 2011-03-04
    • 1970-01-01
    • 2021-04-26
    • 1970-01-01
    • 2012-11-28
    • 2016-04-30
    • 1970-01-01
    • 2013-11-11
    相关资源
    最近更新 更多