【问题标题】:Thread 1: Signal SIGABRT In AppDelegate when you run it线程 1:运行时在 AppDelegate 中发出 SIGABRT 信号
【发布时间】:2015-07-20 12:39:37
【问题描述】:

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

线程 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

   
            }

【问题讨论】:

  • 当您收到错误时,您是否在 Xcode 调试窗口中看到任何其他消息?

标签: ios swift parse-platform


【解决方案1】:

当我收到 SIGABRT 或 EXECBREAKBOINT(或类似)错误时,几乎总是我忘记删除或正确连接的 Storyboard 连接。如果您重命名一个 Outlet 或 Action,或者从代码中删除它,但没有从您的标签/按钮/任何东西中删除连接,就会发生这种情况。

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

委托代码没有问题,如果仅此而已。

更新:

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

如果您将主视图 (TableViewController) 设置为初始值,您会因为解包 nil 值而崩溃。这是因为 PFUser.currentUser() 不包括用户的所有列(如果我没记错,你可以测试它是否适合你,我没有你的类设计)。

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

顺便说一句,如果您现在想跳过整个注册/登录过程,Parse 有一个很棒的用户界面可以实现。 https://parse.com/docs/ios/guide#user-interface

【讨论】:

  • 我似乎找不到任何东西。有没有找到他们@mattias
  • 可能有办法,但我不知道。你可以选择黄色的东西,选择整个ViewController,然后检查连接选项卡。
  • i.imgur.com/24zJoeK.png 在此示例中,顶部插座(由信息文本覆盖)是错误的,并且 containerView 插座也已损坏(“药丸”形状的东西而不是实心圆圈“)。
  • 对不起,我删除了唯一的,但是如果我将项目发送过来,错误仍然存​​在,请你看看它
  • 当然,将其发布到 Dropbox 或其他东西。删除你的 Parse Keys,我可以使用我自己的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-30
  • 1970-01-01
相关资源
最近更新 更多