【发布时间】:2016-08-04 14:52:46
【问题描述】:
说明
所以我决定再次启动我的应用程序,在完成干净并重新安装后,发现我遇到了崩溃,这会将我发送到 AppDelegate.swift 顶部的“线程 1:信号 SIGABRT”文件。当我只是通过显示(推送)到堆栈的按钮浏览视图时发生错误。我什至尝试在我试图到达的视图上注释掉函数,以确保它不是由于某种原因引发错误的函数。下面,我将附上一些与我试图到达的视图和我当前所在的视图相关的代码 sn-ps。抱歉,如果这看起来含糊不清。这只是我遇到的一个非常模糊的问题。
代码
class back4: UIViewController, UITextFieldDelegate{
@IBOutlet weak var no: UIButton!
@IBOutlet weak var yes: UIButton!
@IBOutlet weak var distance: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
/*
@IBAction func save(_ sender: AnyObject) {
let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
let context:NSManagedObjectContext = appDel.managedObjectContext
let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
entity1.crawlerDistance = distance.text
}
@IBAction func yes(_ sender: AnyObject) {
let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
let context:NSManagedObjectContext = appDel.managedObjectContext
let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
entity1.crawlerAbrasion = "yes"
}
@IBAction func no(_ sender: AnyObject) {
let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
let context:NSManagedObjectContext = appDel.managedObjectContext
let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
entity1.crawlerAbrasion = "no"
}
*/
@IBAction func back(_ sender: AnyObject) {
if let navController = self.navigationController {
navController.popViewController(animated: true)
}
}
}
-
^ 这是我试图通过连接到按钮的显示序列到达的视图的代码*
class back3: UIViewController, UITextFieldDelegate{ override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func back(_ sender: AnyObject) { if let navController = self.navigationController { navController.popViewController(animated: true) } } }
^ 这是附加到我当前所在视图的代码
回顾
同样,除了 AppDelegate.swift 顶部的“线程 1:信号 SIGABRT”之外,我没有收到任何错误消息。我也已经检查过意外的多重连续按钮,因为我知道我过去不小心做过。我正在使用 swift 3 和 xcode 8.0
调试器控制台
2016-08-04 10:05:32.239 原型检查 [9292:4560823] CUIcatalog:提供的资产名称无效
2016-08-04 10:05:32.241 Prototype Inspection[9292:4560823] 无法加载从标识符为“Wirtgen.Prototype-Inspection”的捆绑包中的 nib 引用的“”图像
2016-08-04 10:05:33.732 Prototype Inspection[9292:4560823] CUIcatalog:提供的资产名称无效:
2016-08-04 10:05:33.733 Prototype Inspection[9292:4560823] 无法加载从标识符为“Wirtgen.Prototype-Inspection”的捆绑包中的 nib 引用的“”图像
2016-08-04 10:05:34.609 原型检查 [9292:4560823] CUIcatalog:提供的资产名称无效:
2016-08-04 10:05:34.610 Prototype Inspection[9292:4560823] 无法加载从标识符为“Wirtgen.Prototype-Inspection”的捆绑包中的 nib 引用的“”图像
2016-08-04 10:05:35.981 Prototype Inspection[9292:4560823] Interface Builder 文件中的未知类 back4。
2016-08-04 10:05:36.010 Prototype Inspection[9292:4560823] *** 由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不是键值编码- 符合关键距离。'
*** 首先抛出调用栈:
(0x180a42db0 0x1800a7f80 0x180a42a70 0x18134f6e4 0x185f15de8 0x186078eb0 0x180966888 0x186077898 0x185f19230 0x185cde118 0x185ba08ec 0x185bb90d0 0x185d53e5c 0x185c5fe40 0x185c5fb1c 0x185c5fa84 0x185b9c1e4 0x18352e994 0x1835295d0 0x183529490 0x183528ac0 0x183528820 0x185b9eff4 0x1809f909c 0x1809f8b30 0x1809f6830 0x180920c50 0x182208088 0x185c0a088 0x1000ad4c8 0x1804be8b8) P>
libc++abi.dylib:以 NSException 类型的未捕获异常终止 (lldb)
【问题讨论】:
-
调试器控制台说什么?
-
这些错误可能涉及情节提要,因为您没有明确的代码内
pushsegues。你能把整个项目上传到某个地方吗? -
该调试控制台说:***第一掷调用堆栈:(0x180a42db0 0x1800a7f80 0x180a42a70 0x18134f6e4 0x185f15de8 0x186078eb0 0x180966888 0x186077898 0x185f19230 0x185cde118 0x185ba08ec 0x185bb90d0 0x185d53e5c 0x185c5fe40 0x185c5fb1c 0x185c5fa84 0x185b9c1e4 0x18352e994 0x1835295d0 0x183529490 0x183528ac0 0x183528820 0x185b9eff4 0x1809f909c 0x1809f8b30 0x1809f6830 0x180920c50 0x182208088 0x185c0a088 0x1000ad4c8 0x1804be8b8) libc++abi.dylib: 以 NSException (lldb) 类型的未捕获异常终止
-
我愿意私下分享这个项目,但我不能有一个公共链接,因为它是一个公司项目@BaseZen
-
上面的调试控制台中可能还有更多内容。将所有内容添加到问题中。