每次停止模拟器后,Xcode 4.2都会跳转到main.m. [英] Xcode 4.2 jumps to main.m every time after stopping simulator

查看:176
本文介绍了每次停止模拟器后,Xcode 4.2都会跳转到main.m.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这更令人烦恼。每次停止模拟器后,Xcode都会因某种原因跳转到main.m.在左侧导航栏中,它会跳转到Debug Navigator。

This is more of a general annoyance. Every time after stopping the simulator, Xcode jumps to main.m for some reason. On the left nav, it jumps to the Debug Navigator.

有没有办法解决这个问题?

Is there a way to fix this?

这很烦人,因为我可能正在测试某一行代码,现在每次都需要点击几下才能回到那段代码。

It's annoying because I might be testing a certain line of code, and now each time, I need to make a couple of clicks just to go back to that code.

这个问题不是新的,但似乎变得更糟。在撰写本文时,我是转基因种子,但这个问题在XCode 4.2 final中仍然存在。这在以前版本的XCode中不是问题。

This problem is not new, seems to get worse though. At the time of writing this, I was on the GM seed, but this problem persists in XCode 4.2 final. This was not a problem in previous versions of XCode.

推荐答案

当我们从xcode开始调试时,调试器将自己设置为监视器来自OS的信号。当我们按下XCode中的停止按钮(或点击cmd + R - 首先停止现有实例运行然后尝试启动新实例时,我们先按手动停止然后再运行) SIGKILL被发送到调试器即可。

When we start debug from xcode, the debugger sets itself up to monitor signals from OS. When we press stop button in XCode (or hit cmd + R - which first stops existing instance running and then try to start new one, somewhat equalant to we press manually stop first and then run) SIGKILL is sent to the debugger.

每当中断的原因来自应用程序外部(换句话说,所有发送SIGKILL的情况,如停止按下按钮),调试程序跳转到 main ,因为 main是应用程序的根目录以及应用程序符合操作系统的位置。调试器无法识别为什么发出此SIGKILL(按xcode中的停止按钮/从多任务栏中按cmd + R /删除应用程序等),但它将SIGKILL视为外部中断,并且与您的代码无关。所以它跳到主要。

Whenever the cause of interruption is from outside the app (in other words all cases where SIGKILL is sent, like stop button press) , debugger jumps to main, since main is the root of the app and the place where your app meets the OS. Debugger has no way to identify why this SIGKILL is issued (pressing stop button in xcode/ press cmd + R/ delete app from multitasking bar etc), but it treats SIGKILL as outside interrupt, and nothing related with your code. So it jumps to main.

如果中断的原因来自应用内部(如app crash / SIGABRT),调试器会处理它并跳转到崩溃的地方,我们通常会看到它。

If the cause of interruption is from inside the app (like app crash/SIGABRT) debugger handles it and jumps to the place of crash, which we normally see.

我不认为这是一个xcode错误,而是处理SIGKILL的常规方法。但是如果你想留下你的代码并且不想跳到主要你可以做两件事

I do not consider this as an xcode bug, rather a normal way of handling SIGKILL. But if you want to stay at your code and do not want to jump to main you can do two things


  1. 你可以做正如加布建议的那样。正如BBonified所说,它就像一个乐队助手,
    ,但我认为它应该有用(我个人从来没有尝试过)

  1. You can do as Gabe suggested. As BBonified said, it is like a band-aide, but I think it should work (personally I never tried that)

报告错误/请求此处的功能。让我告诉你,
不是第一个这样做的人。已经报告了一个错误。请参阅
这个。但我对Apple的积极行动没有多大希望

Report a bug/request for a feature here. Let me tell you you are not the first one to do so. Already a bug has been reported. See this and this. But I don't have much hope of a positive action from Apple

我同意你的看法烦人。特别是如果您在之前的XCode版本中遇到过不同的体验。但我们只能拿走他们在这里给出的东西。

And I agree with you, it is sometimes annoying. Especially if you have experienced differently in previous XCode versions. But we can only take what they give here.

这篇关于每次停止模拟器后,Xcode 4.2都会跳转到main.m.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆