ios - 在 Swift 中运行 Firebase 时出错

标签 ios swift uikit firebase

我正在玩弄 Firebase,并尝试在 Swift 中打印项目的值。这是整个应用程序中唯一的代码,因此没有真正复杂的事情发生。

var myRootRef = Firebase(url:"https://jotty.firebaseio.com/")

override func viewDidLoad() {
    super.viewDidLoad()

    myRootRef.observeEventType(.Value, withBlock: {

        snapshot in
        println(snapshot.value)

    })

}

当我运行它时出现错误:

2015-07-15 12:15:03.492 Jotty[32431:733653] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FRepo youForgotToSetMinusObjCInTheOtherLinkerFlagsInYourXCodeProject]: unrecognized selector sent to instance 0x7b28b7a0'

有人知道怎么解决吗?我一整天都在尝试解决这个问题,但我不知道应用程序出了什么问题。

最佳答案

在“其他链接器标志”下的“build设置”中使用“-ObjC”标志。

enter image description here

I recommend using CocoaPods而不是手动设置

See the Firebase docs for a manual setup .

关于ios - 在 Swift 中运行 Firebase 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31439224/

相关文章:

ios - 定位 ARKIT 模型

ios - swift fatal error : unexpectedly found nil while unwrapping an Optional value (lldb) in Tableview

javascript - 在 iOS Swift 中处理 Javascript 文件下载

swift - 先决条件失败 : Negative count not allowed

arrays - Swift 3 二维 Int 数组

ios - 将 UITableViewDataSource 与具有 subview 的自定义单元格一起使用

ios - 在 Xcode 9 中构建时更改 AppIcon

objective-c - Xcode 应用卡在横向模式

ios - tableView.reloadRows(at : [indexPath], with : . none) 会像这样崩溃吗?

ios - Xcode 模拟尺寸指标 - Freeform 和 None 设置之间的区别