繁体   English   中英

线程1:运行AppDelegate时发出信号SIGABRT

[英]Thread 1: Signal SIGABRT In AppDelegate when you run it

当您尝试运行它时,我的应用程序委托得到以下信息:

线程1:信号SIGABRT

当您运行应用程序时会发生此问题,但有时它会变成断点错误,请帮助我

有谁知道如何解决此问题。 我的AppDelegate代码发布在下面;

 import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { Parse.enableLocalDatastore() // Initialize Parse. Parse.setApplicationId("XXXXXXXXXXXXXXXX", clientKey: "XXXXXXXXXXXXXXXXXXXXX") return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } // MARK: - Split view } 

当我收到SIGABRT或EXECBREAKBOINT(或类似错误)错误时,几乎总是我忘记删除或正确连接的Storyboard连接。 如果重命名“插座”或“动作”,或从代码中将其删除,但没有从“标签/按钮/任何地方”删除连接,则将发生这种情况。

我不知道为什么发生错误时它会显示AppDelegate,但它总是会显示。

代表代码没有错,仅此而已。

更新:

好的,您还没有足够的代表来聊天,但是我发现了您的主要错误:如果您点击文件浏览器顶部的蓝色图标,即显示“ GymAmigo”,然后转到“常规”标签,则主界面为设置为iPhone。 在下拉菜单中将其更改为Main.Storyboard。 然后,您还有其他问题。 我建议您在Main.Storyboard中,在右侧的属性检查器中将“注册”或“登录”控制器设置为“初始视图控制器”,该控制器可以在模拟器中运行并运行。

如果将主视图(TableViewController)设置为初始视图,则由于展开nil值而会导致崩溃。 这是因为PFUser.currentUser()并未包括该用户的所有列(如果我没记错,您可以测试它是否对您有用,我没有您的类设计)。

调试时激活控制台(“查看/调试区域/激活控制台”)。 在那里,您会收到错误消息,比“ SIGARBT”更容易理解。

顺便说一句,如果您现在想跳过整个注册/登录过程,可以使用Parse出色的UI。 https://parse.com/docs/ios/guide#user-interface

看起来您与不再存在的插座之间存在缠绵的连接 也许您删除了先前设置的textField?

在Xcode编辑器中Ctrl //右键单击文件的所有者 ”,查找警告三角形。 清除掉(通过删除连接或将其重新连接到正确的插座),可能会很好。

您单击每个视图控制器顶部黄点

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM