如何使用我的应用修复此 SIGABRT 错误?

发布于 2025-01-02 19:14:35 字数 1468 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

说好的呢 2025-01-09 19:14:35

如果模拟器上发生这种情况,请重新启动计算机。如果这种情况发生在真实设备上,请重新启动设备,如果问题仍然存在,请重新启动计算机。这个问题对我来说已经发生过多次,因为当测试意外中止时,设备/模拟器上留下了僵尸进程。简单的重新启动即可修复它。

If this is happening on the simulator, restart your computer. If this is happening on a real device, restart the device, and if the problem persists, restart the computer as well. This problem has occurred for me multiple times, because of a zombified process left on the device/simulator when a test is unexpectedly aborted. A simple reboot will fix it.

泪眸﹌ 2025-01-09 19:14:35

您的所有代码都通过 main.m 运行。因此,您真正想看到的是堆栈跟踪,并且有一个很好的示例这里,但我看到你正在使用自动释放池,所以你需要类似的东西

//
//  main.m
//  MyCard
//
//  Created by Nazar Gren on 2/2/12.
//  Copyright (c) 2012 Nazar Gren. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "mycardAppDelegate.h"

int main(int argc, char *argv[])
{
     @autoreleasepool {
        @try {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([mycardAppDelegate class]));
        } @catch (NSException *e) {
            NSLog(@"CRASH: %@", e);
            NSLog(@"Stack Trace: %@", [e callStackSymbols]);
        }
     }
 }

All your code gets run through the main.m. So what you really want to see is a stack trace and there's is a good example here, but I see you're using the autoreleasepool so you'll need something like

//
//  main.m
//  MyCard
//
//  Created by Nazar Gren on 2/2/12.
//  Copyright (c) 2012 Nazar Gren. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "mycardAppDelegate.h"

int main(int argc, char *argv[])
{
     @autoreleasepool {
        @try {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([mycardAppDelegate class]));
        } @catch (NSException *e) {
            NSLog(@"CRASH: %@", e);
            NSLog(@"Stack Trace: %@", [e callStackSymbols]);
        }
     }
 }
一萌ing 2025-01-09 19:14:35

这不在主代码中。可以在任何地方。请尝试仪器中的僵尸工具。您可能正在尝试访问已经释放的对象。 NSZombie 会告诉你哪个是物体,你可以从那里进行调查。

This is not in Main code. Can be anywhere. Please try zombie tool in instruments. You are probably trying to access an object which has been already released. NSZombie will tell you which is the object and you can investigate from there.

深海里的那抹蓝 2025-01-09 19:14:35

您是否删除了对主故事板中附加内容的引用?

如果是这样,请检查该对象的引用出口,看看它是否仍在尝试指向某些内容,尝试删除该引用并再次运行模拟器...

Did you remove a reference to something attached in your main storyboard?

If so, checkout the referencing outlets of that object to see if it's still trying to point to something, try removing that reference and running your simulator again...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文