0
所以我有2个问题:为什么图像未存储在Firebase存储中,URL是否为零?
- 所以我有一个对象,其中两个属性存储图像。我成功将图像存储在Firebase存储中,并将图像名称存储在数据库中。假设我有两张照片,我只有一张。
- 我只能访问图像的名称,但每当我尝试打印出网址时,都会说
nil
。
下面是一些代码片段:
//MARK: - Make Object
func makeObjectPost(title: String, imageTitle: UIImage, content: [String: AnyObject]) {
//Make a new post object
let postObject = PostModel()
postObject.title = title
postObject.imageTitle = returningImageData(image: imageTitle)
postObject.content = content
//Save the new object to firebase
postObject.save { (ref, error) in
if error != nil {
print(error?.localizedDescription)
}
}
}
makeObjectPost(title: "Third Post", imageTitle: #imageLiteral(resourceName: "william-iven-19844"), content: makeContentDict(contentPost: currPost))
我的回答对你有帮助吗? –