【发布时间】:2017-04-18 01:56:03
【问题描述】:
我在 firebase 中有一个数据库,我想使用这些数据,并将其保存到我的对象的变量中,但是我不明白如何执行此操作。我已阅读 Firebase 文档,但没有。
到目前为止,我只有这个
let guia = firebase.child("guias_administracao")
guia.observe(FIRDataEventType.value, with: { (snapshot) in
print(snapshot.value as Any)
for item in snapshot.children{
let g = GuiaAdmModel(
link: (item as! String),
nome: (item as! String),
videoLink: (item as! String)
)
self.listGuiaAdm.append(g)
}
当我运行时,这个错误返回给我
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Optional(<__NSArrayM 0x600000246db0>(
<null>,
{
link = "guia_administracao/MERCK_GUIA_UTILIZACAO_DIGITAL_fertilidade_2016_09_22_Cetrotide.pdf";
nome = Cetrotide;
videoLink = "//player.vimeo.com/video/183506335?color=ff0179&byline=0&portrait=0";
},
{
link = "guia_administracao/MERCK_GUIA_UTILIZACAO_DIGITAL_fertilidade_2016_09_22_Crinone.pdf";
nome = Crinone;
videoLink = "";
},
{
link = "guia_administracao/MERCK_GUIA_UTILIZACAO_DIGITAL_fertilidade_2016_09_22_Gonalf.pdf";
nome = Gonalf;
videoLink = "";
},
{
link = "gs://fertility-b4db3.appspot.com/guia_administracao/Ovidrel.pdf";
nome = Ovidrel;
videoLink = "";
}
)
)
Could not cast value of type 'FIRDataSnapshot' (0x1061f7260) to 'NSString' (0x1079fdc60).
请帮帮我 一些示例或教程会很有帮助
【问题讨论】:
标签: ios rest firebase swift3 firebase-realtime-database