当您尝试运行时,我的应用代理会收到以下信息:
线程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
}
答案 0 :(得分:2)
当我收到SIGABRT或EXECBREAKBOINT(或类似)错误时,几乎总是一个Storyboard连接,我忘记删除或正确连接。如果重命名Outlet或Action,或从代码中删除它,但不删除Label / Button / Whatever中的连接,则会发生这种情况。
我不知道为什么它会在发生错误时显示AppDelegate,但它始终如此。
委托代码没有问题,如果全部的话。
更新:
好吧,你还没有足够的代表聊天,但我发现你的主要错误: 如果单击文件浏览器顶部的蓝色图标,则表示" GymAmigo"并前往"将军"选项卡您的主界面设置为iPhone。在下拉列表中将其更改为Main.Storyboard。然后你还有其他一些问题。我建议您将注册或登录控制器设置为初始视图控制器,在右侧的属性检查器中,在Main.Storyboard中,它可以工作并在模拟器中运行。
如果将主视图(TableViewController)设置为初始视图,则会因为解包nil值而导致崩溃。这是因为PFUser.currentUser()没有包含用户的所有列(如果我没错,你可以测试它是否适合你,我没有你的班级设计)。
调试时激活控制台,(查看/调试区域/激活控制台)。在那里,您将收到错误消息,比#34; SIGARBT"更容易理解。
顺便说一句,如果你想暂时跳过整个注册/登录过程,Parse有一个很棒的用户界面你可以实现。 https://parse.com/docs/ios/guide#user-interface
答案 1 :(得分:0)
您似乎与不再存在的插座之间存在延迟的连接。也许您删除了之前设置的textField?
在Xcode编辑器中的文件所有者上按单击每个视图控制器的 top 上的黄点。