应用程序在加载 main.m 时出现错误而崩溃

发布于 2024-12-11 16:42:31 字数 483 浏览 0 评论 0原文

我正在尝试恢复一个我意外删除的应用程序,并设法通过管理器完成此操作,但是,现在当我尝试在模拟器或 iPhone 上运行它时,它崩溃并在 main.m 文件中弹出错误:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

错误发生在“return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));”文件中存在 SIGABRT 错误的部分。我正在使用 Xcode 4.2,并启用 ARC。我正在 ios 4.3 和 ios 5.0 上测试它。该应用程序之前可以运行,事实上,现在已经在应用程序商店上架了。任何事情都会有所帮助

I'm trying to recover an app that I accidentally deleted and managed to do it through the organizer, however, now when I try to run it on the simulator or iphone, it crashes with an error popping up in the main.m file:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

The error occurs in the "return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));" section of the file with the SIGABRT error. I am using Xcode 4.2 with ARC on. I am testing it on ios 4.3 and ios 5.0. The app was working before and in fact, is on the app store right now. Anything would help

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

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

发布评论

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

评论(9

‘画卷フ 2024-12-18 16:42:31

如果您查看调试器,它可能会告诉您导致错误的原因。由于内存不足(屏幕上同时显示太多项目),这种情况以前发生在我身上。无论哪种方式,请查看目标调试器以了解导致错误的原因。

If you look in the debugger it will probably tell you what caused the error. This has happened to me before, due to insufficient memory (too many items on screen at once). Either way, look at the target debugger for what caused the error.

时常饿 2024-12-18 16:42:31

通常,当我遇到类似的错误时,是因为界面生成器上的链接已损坏。也许您更改了 IBOutlet 的名称并忘记再次连接它。

Usually when I get similar errors is because there is a broken link on the Interface Builder. Maybe you've changed the name of an IBOutlet and forgot to connect it again.

触ぅ动初心 2024-12-18 16:42:31

如果您使用故事板,请确保您没有连接重复的引用插座或代码中不再存在的参考插座。换句话说,如果您从视图控制器上的按钮拖动到代码,然后属性或方法发生了根本变化,您可能会收到此错误。

在此处输入图像描述

If you are using Storyboards, make sure you haven't hooked up duplicate referencing outlets or reference outlets that aren't there anymore in your code. In other words, if you dragged from a button on your view controller to your code and then the property or method has changed at all, you can get this error.

enter image description here

鹤舞 2024-12-18 16:42:31

发生在我身上,查看调试器,发现它提到了我给一个操作指定的名称,但在创建 viewController .h 和 .m 后将其删除,因此出于某种原因,使用不同名称创建的旧操作仍然在某处徘徊...所以我复制了我的代码并将其粘贴到一个新的程序上。当然,这是一个非常小的单视图应用程序,所以很容易......

happened to me, looked in the debugger and found it mentioned a name I given to an action, but deleted it after I created it both viewController .h and .m so for some reason that old action created with a different name, still lingered somewhere... so I copied my code and pasted it on a new prog. Of course, it was a very small one view app so it was easy...

吝吻 2024-12-18 16:42:31

如果不存在以下构建设置,我以前见过这种情况发生。 OTHER_LDFLAGS = -ObjC -all_load

这位于目标中的“链接”下。

I've seen this happen before if the following build settings are not there. OTHER_LDFLAGS = -ObjC -all_load

This is under Linking in the target.

落花随流水 2024-12-18 16:42:31

不确定错误消息是什么——这会很有帮助。但是您要导入 AppDelegate.h 吗?

Not sure what the error message is—that would be helpful. But are you importing AppDelegate.h?

淡笑忘祈一世凡恋 2024-12-18 16:42:31

这发生在我身上,我所做的只是更改了图像视图的名称,然后又将其改回来。但是,我删除后忘记断开另一个名称的连接。但是,一旦我将其与界面生成器断开连接,它就可以工作了。

It happened to me and all I did was changed the name of my image view and than changed it back later. But, I forgot to disconnect the other name after I deleted it. However, once I disconnected it from interface builder it worked.

司马昭之心 2024-12-18 16:42:31

使用 LLDP 调试器崩溃,我更改为 GDB,然后它就工作了。

我也遇到了这个问题,但并非总是只有 1/2 启动。控制台中绝对没有错误,什么也没有,只是一个信号 SIGARBT。我的 AppDelegate 甚至没有去 didFinishLaunchingWithOptions。将调试器更改回 GDB(编辑方案...>(信息选项卡)调试器>LLDB)解决了问题。

Crashed with LLDP debugger I changed to GDB and then it worked.

I got stuck with this problem too but not all the time only 1/2 launch. Absolutely no error in the console no nothing, just a signal SIGARBT. My AppDelegate did not even went to didFinishLaunchingWithOptions. Changing the debugger back to GDB (Edit Scheme… > (Info tab) Debugger > LLDB) solved the problem.

迷路的信 2024-12-18 16:42:31

要修复此问题,请单击 mainstoryboard(即 Interface Builder),选择“文件检查器”选项卡,然后取消选中“使用自动布局”。
或者,如果您绝对必须具有自动布局,则可以针对仅限 iOS 6.0+ 的设备并更改最小目标。
出现此问题的原因是 xcode 版本与学习程序来源不匹配。

To fix it, click on mainstoryboard i.e. Interface Builder, select the File Inspector tab, and uncheck Use autolayout.
Alternatively, you can target iOS 6.0+-only devices and change the minimum target, if you absolutely must have autolayout.
This problem occurs due to mismatch in versions of xcode and source of learning programs from.

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