2016-05-23 27 views
1

在Swift中构建适用于iOS的Firebase教程应用程序时,我陷入了第8页的设置应用程序以允许用户发送图像消息的说明中。这可能是教程中显示的代码出错,或者我的框架没有正确连接,但我更新了窗格并清理并重新构建了应用程序,并且两次都得到此错误。Constants.MessageFields列出了.imageUrl。Firebase iOS Codelab Chat应用程序教程中的错误

代码:

if let imageUrl = message[Constants.MessageFields.imageUrl] { 

错误:

"Type 'Constants.MessageFields' has no member 'imageUrl'"

This is a fatal error and build always fails on this line.

链接到这个网页教程here

回答

1

它缺少在Constants.swift文件。只需将以下代码添加到MessageFields结构中:

static let imageUrl = "imageUrl" 
相关问题