【问题标题】:iOS 9 Command failed due to signal: Segmentation fault: 11iOS 9 命令因信号而失败:分段错误:11
【发布时间】:2015-09-30 07:55:17
【问题描述】:

我最近升级到 Xcode 7。我的代码在 6.3 和 iOS 8.4 上运行良好,现在无法编译,出现分段错误。

我正在使用 SQLite 的 Stephencelis 库。这似乎是导致问题的原因。

我将不胜感激任何帮助,任何想法。 以下是错误消息的最后一部分:

  1. 在 /Users/luben/Downloads/SQLite.swift-master/SQLite/Query.swift:740:22 对 columnNames 进行类型检查时
  2. 在 /Users/luben/Downloads/SQLite.swift-master/SQLite/Query.swift:740:51 的类型检查声明 0x7fbab3ee2d68 时
  3. 在 [/Users/luben/Downloads/SQLite.swift-master/SQLite/Query.swift:740:51 - line:774:7] RangeText="{ var (columnNames, idx) = (String: Int, 0) 列:对于 self.query.columns 中的每个 ?? [表达式(文字:“*”)] { 让 pair = each.expression.SQL.characters.split { $0 == "." }.map { 字符串($0) } let (tableName, column) = (pair.count > 1 ? pair.first : nil, pair.last!)

        func expandGlob(namespace: Bool) -> Query -> Void {
            return { table in
                var query = Query(table.database, table.tableName.unaliased)
                if let columns = table.columns { query.columns = columns  }
                var names = query.selectStatement.columnNames.map { quote(identifier: $0) }
                if namespace { names = names.map { "\(table.tableName.SQL).\($0)" } }
                for name in names { columnNames[name] = idx++ }
            }
        }
    
        if column == "*" {
            let tables = [self.query.select(*)] + self.query.joins.map { $0.table }
            if let tableName = tableName {
                for table in tables {
                    if table.tableName.SQL == tableName {
                        expandGlob(true)(table)
                        continue column
                    }
                }
                assertionFailure("no such table: \(tableName)")
            }
            tables.map(expandGlob(self.query.joins.count > 0))
            continue
        }
    
        columnNames[each.expression.SQL] = idx++
    }
    return columnNames
    

    }()"

【问题讨论】:

    标签: ios swift sqlite


    【解决方案1】:

    GitHub 上的 SQLite.swift 项目提供了一个Swift 2 branch。应该可以解决问题了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-14
      相关资源
      最近更新 更多