【发布时间】:2016-12-28 01:08:04
【问题描述】:
我生气了
由于信号导致命令失败:分段错误:11
当我在我的项目中使用 Firebase 时。
我在这里阅读了多个关于这个 Xcode 错误的问题,但在使用 Firebase 时它非常持久。
我尝试了许多解决方案,例如清理项目、重建、禁用位码、删除派生数据等。
我的代码:
@IBAction func saveBook(sender: UIBarButtonItem) {
var arrayOfNames : [String] = [String]()
for i in 0 ..< 6 {
let indexPath = NSIndexPath(forRow:i, inSection:0)
let cell : LongNameTableViewCell? = self.tableView.cellForRowAtIndexPath(indexPath) as! LongNameTableViewCell?
if let item = cell?.textField.text {
arrayOfNames.append(item)
}
}
self.ref.child("books").childByAutoId().setValue(["title": arrayOfNames[0], "author": arrayOfNames[1], "pages_count":arrayOfNames[2]])
self.dismissViewControllerAnimated(true, completion: nil)
}
【问题讨论】:
-
与我的情况相比很奇怪,因为我需要做的唯一解决方案是清理我的项目文件夹,以摆脱这个失败。
标签: ios swift xcode firebase firebase-realtime-database