简体   繁体   English

Xcode 6.0.1分段错误11

[英]Xcode 6.0.1 Segmentation Fault 11

I cannot build my project due to an error(Segmentation Fault 11). 由于出现错误,我无法构建项目(Segmentation Fault 11)。 With commenting things out, I found that the error is thrown by this line: 在注释掉所有内容后,我发现此行引发了错误:

typealias functionType = ([Expression], [String: NSNumber], inout AnyObject) -> Expression!;

If I remove the typealias and use the raw type instead, the error gets still thrown, so the mistake is probably not the typealias, but the closure. 如果我删除了typealias并改用了原始类型,则仍然会抛出错误,因此错误可能不是typealias,而是闭包。

Edit: 编辑:
If I replace the type Expression with AnyObject the error gets still thrown. 如果我将类型Expression替换为AnyObject ,仍然会引发错误。 But if I just declare the typealias, I can use it for a global variable but not for a member variable. 但是,如果仅声明类型别名,则可以将其用于全局变量,但不能用于成员变量。

I also got this error (following an online tutorial), I removed all the code I entered before to get this error and the problem persist, it seems to me as the project was corrupted. 我也遇到了此错误(在线教程之后),我删除了之前输入的所有代码以获取此错误,并且问题仍然存在,在我看来,项目已损坏。 I'm not an expert so please take this report with caution. 我不是专家,因此请谨慎使用此报告。

This is happened just after appeared an error HUD telling sourceKitService Crashed... 这是在出现HUD告诉sourceKitService崩溃的错误之后发生的。

The probably offending code was this one: 可能令人讨厌的代码是以下代码:


         override func viewWillAppear(animated: Bool) {
     if var storedtoDoItems: AnyObject! = NSUserDefaults.standardUserDefaults().objectForKey("toDoItems") {

        toDoItems = []
         for var i = 0; i < storedtoDoItems.count; ++i {
             toDoItems.append(storedtoDoItems[i] as NSString)
          }
         println(storedtoDoItems)
    }

     taskTable.reloadData()
 }

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

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