【发布时间】:2017-05-10 19:45:11
【问题描述】:
我正在尝试将Firebase 中的数组显示为UITableView。这就是我所拥有的:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "FriendCell", for: indexPath) as UITableViewCell
let otherVC = FriendCell()
otherVC.usernameText?.text = friends[indexPath.row]
print(friends[indexPath.row])
return cell
}
当我print(friends[indexPath.row]) 时,它会正确显示该子项中的所有用户。我试图让每个用户进入他们自己的UITableViewCell。我尝试引用单元控制器,然后将 usernameText 与情节提要链接,但它不起作用。
【问题讨论】:
标签: ios swift uitableview firebase firebase-realtime-database