(lldb) Xcode 上的运行时错误 [英] (lldb) Run time Error on Xcode
问题描述
我有这段代码,但它对我不起作用并导致运行时错误
I have this code and it is not working for me and creating a runtime error
-(void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
//position button
myButton.frame = CGRectMake(50, 50, 50, 50);
[myButton setTitle:@"\u2606" forState:UIControlStateNormal];
// add targets and actions
[myButton addTarget:self action:@selector(myButtonClicked) forControlEvents:UIControlEventTouchUpInside];
// add to a view
[self.view addSubview:myButton];
}
-(void)myButtonClicked{
[myButton setTitle:@"\u2605" forState:UIControlStateNormal];
}
我从这个网站得到了这个,但找不到消除这个运行时错误的方法.谢谢
I got this from this website and cannot find a way to remove this runtime error. Thanks
推荐答案
这几乎是猜测,但我确实遇到了同样的问题.
This is pretty much guessing, but I did experience the same problem.
这可能是巧合,但对我来说这个问题是在我将 OS X 更新到 10.8.4 后第一次出现的.从那以后,每一次 Run 都以崩溃告终.
It might be coincidence, but for me this problem appeared the first time after I updates OS X to 10.8.4. Since then every other Run ends in a crash.
我的案例的回溯如下:
(lldb) bt
* thread #1: tid = 0x1c03, 0x9573da6a libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
frame #0: 0x9573da6a libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x9476ab2f libsystem_c.dylib`pthread_kill + 101
frame #2: 0x024e857b libsystem_sim_c.dylib`abort + 140
frame #3: 0x026afb4e GraphicsServices`GSRegisterPurpleNamedPort + 348
frame #4: 0x026af69f GraphicsServices`_GSEventInitialize + 123
frame #5: 0x026afc1f GraphicsServices`GSEventInitialize + 36
frame #6: 0x0076ed99 UIKit`UIApplicationMain + 600
frame #7: 0x0000225d XXX 3`main(argc=1, argv=0xbffff36c) + 141 at main.m:16
frame #8: 0x00002185 XXX 3`start + 53
由于它在所有发布的 50% 中都运行良好,并且在我进行更新之前的几个月内运行良好,并且它与 gdb 一起运行,因此我很确定这是 Apple 方面的一个错误.
Since it works perfectly fine 50% of all launches, and it worked the months before I did the update, and it works with gdb, I'm pretty sure this is a bug on Apples side.
此问题的解决方法可能是从 lldb 切换到 gdb.它对我有用.
A workaround for this problem might be to switch from lldb to gdb. It worked for me.
您在方案编辑器中执行此操作(按 command + <).在运行方案中将调试器更改为 gdb.
You do this in the scheme editor (press command + <). Change the debugger to gdb in the Run scheme.
因为这就像第三个问题(其他人已经关闭)或者我在 10.8.4 发布后的几天内在 stackoverflow 上看到的,所以我很确定这种行为与更新有关.
Since this is like the third question (others were closed already) or so that I saw on stackoverflow in the few days since 10.8.4 was released I'm pretty sure this behaviour is related to the update.
这篇关于(lldb) Xcode 上的运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!