Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS应用程序崩溃-不确定下一步要查找的位置_Ios_Ios5 - Fatal编程技术网

iOS应用程序崩溃-不确定下一步要查找的位置

iOS应用程序崩溃-不确定下一步要查找的位置,ios,ios5,Ios,Ios5,我正在开发一个简单的iOS应用程序,这是我在工作中接手的。我添加了一个具有UIWebView并从表视图导航到的控制器。我可以在其上执行pushViewController,但当我返回时,应用程序会在此处崩溃: - (void)dealloc { myWebView.delegate = nil; // Thread 1 stopped at breakpoint 1 } 控制台上显示: [Switching to process 621 thread 0x13b03] [Switch

我正在开发一个简单的iOS应用程序,这是我在工作中接手的。我添加了一个具有UIWebView并从表视图导航到的控制器。我可以在其上执行pushViewController,但当我返回时,应用程序会在此处崩溃:

- (void)dealloc
{
    myWebView.delegate = nil;  // Thread 1 stopped at breakpoint 1
}
控制台上显示:

[Switching to process 621 thread 0x13b03]
[Switching to process 621 thread 0x18703]
[Switching to process 621 thread 0x11903]
显然,我犯了一些错误,但下一步需要去哪里看呢?我正在使用ARC

thx

编辑1

This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 974.
Pending breakpoint 1 - ""WebViewController.m":57" resolved
2012-03-19 08:11:05.888 SpotFinder[974:11903] Latitude = 37.785834
2012-03-19 08:11:05.889 SpotFinder[974:11903] Latitude = -122.406417
2012-03-19 08:11:06.030 SpotFinder[974:11903] here is a log of places 33
2012-03-19 08:11:11.030 SpotFinder[974:11903] You selected index_path: <NSIndexPath 0x705c0d0> 2 indexes [0, 2]
[Switching to process 974 thread 0x13a03]
[Switching to process 974 thread 0x15e03]
[Switching to process 974 thread 0x13a03]
[Switching to process 974 thread 0x11903]
Current language:  auto; currently objective-c
(gdb)
此GDB配置为“x86_64-apple-darwin”。sharedlibrary应用所有加载规则
连接到过程974。
已解决挂起的断点1-“WebViewController.m”:57
2012-03-19 08:11:05.888 SpotFinder[974:11903]纬度=37.785834
2012-03-19 08:11:05.889 SpotFinder[974:11903]纬度=-122.406417
SpotFinder[974:11903]这是一份33个地方的日志
2012-03-19 08:11:11.030 SpotFinder[974:11903]您选择了索引路径:2个索引[0,2]
[切换到进程974线程0x13a03]
[切换到进程974线程0x15e03]
[切换到进程974线程0x13a03]
[切换到进程974线程0x11903]
当前语言:自动;当前目标-c
(gdb)
编辑2 堆栈跟踪:


无论是在非ARC环境中还是在启用ARC的情况下,都不要直接调用dealloc

在非ARC中,您调用
release
,然后系统将在该特定对象上调用dealloc


当对象上不再有引用时,将调用启用ARC的DEALOC(同样由系统调用)。

使用ARC时,可以定义
deALOC
方法来删除引用和清理资源,但不应显式调用
[super deALOC]

看看哪一个是你的一部分

不能显式调用dealloc,也不能实现或调用retain, 释放、重新计数或自动释放。禁令延伸到使用 @选择器(保留)、@选择器(释放)等

如果需要管理资源,可以实现dealloc方法 除了释放实例变量。你不必(真的) 您不能)释放实例变量,但可能需要调用 系统类和其他代码上的[systemClassInstance setDelegate:nil] 这不是使用ARC编译的

ARC中的自定义dealloc方法不需要调用[super dealloc] (它实际上会导致编译器错误)。超级链接是 由编译器自动执行。

您仍然可以使用CFRetain、CFRelease和其他相关函数 使用核心基础样式对象(请参见“管理免费 桥接”)


那些控制台消息是不相关的。控制台上还显示了什么?@timpone?隐马尔可夫模型。。。我得到“ARC禁止dealloc的显式消息发送”@sam,当你使用ARC时不会。如果你有时间,这个关于RayWenderlich的新教程在熟悉调试iOS应用程序方面非常有用:呃,我很高兴这么说,但当我开始看行号时,我意识到还有第二个断点,应用程序实际上并没有崩溃。只是在断点处冻结。我的错误。谢谢大家的帮助