【发布时间】:2015-09-30 07:55:17
【问题描述】:
我最近升级到 Xcode 7。我的代码在 6.3 和 iOS 8.4 上运行良好,现在无法编译,出现分段错误。
我正在使用 SQLite 的 Stephencelis 库。这似乎是导致问题的原因。
我将不胜感激任何帮助,任何想法。 以下是错误消息的最后一部分:
- 在 /Users/luben/Downloads/SQLite.swift-master/SQLite/Query.swift:740:22 对 columnNames 进行类型检查时
- 在 /Users/luben/Downloads/SQLite.swift-master/SQLite/Query.swift:740:51 的类型检查声明 0x7fbab3ee2d68 时
-
在 [/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}()"
【问题讨论】: