TableViewに投稿した内容が表示されず困っています。
初心者です。情報が少ない場合はご指摘してもらえるとありがたいです。
ビルド自体は成功します。
firebaseのrealDatabaseeにアップしたテキストデータを表示したいのですが、
ずっと、読み込みのロードが回り続けているだけで、先に進みません。
コンソールには、
Reading from public effective user settings.
Snap (gSRcWP1UfQSRjTbnRae8oWCuWsn1) {
handle = megum;
name = Megum;
}
2018-06-23 13:57:00.004942+0900 stripe[906:594693] Status bar could not find cached time string image. Rendering in-process.
が表示されていて、imageが取得できていないから、そのさきのテキストデータの取得へと
続かないのだとおもいますが、imageをどうしても取得できず困っています。
HomeViewControllerとHomeViewTableViewCellのコードを下に記します。
何か、お気づきなことがあればお聞かせください。
初心者な的外れな質問であったら大変申し訳ありませんが、何卒よろしくお願いします。
HomeViewController
swift
1 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 2 return self.whiteText.count 3 } 4 5 6 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 7 8 let cell: HomeViewTableViewCell = tableView.dequeueReusableCell(withIdentifier: "HomeViewTableViewCell", for: indexPath) as! HomeViewTableViewCell 9 10 let submitW = whiteText[(self.whiteText.count-1) - (indexPath.row)]!["text"] as! String 11 12 let submitB = blackText[(self.blackText.count-1) - (indexPath.row)]!["text"] as! String 13 14 15 cell.configure(profilePic: nil,name:self.loggedInUserData!["name"] as! String,handle:self.loggedInUserData!["handle"] as! String,whiteText:submitW,blackText:submitB) 16 17 18 return cell 19 }
HomeViewTableViewCell
swift
1import UIKit 2 3public class HomeViewTableViewCell: UITableViewCell { 4 5 @IBOutlet weak var profilePic: UIImageView! 6 @IBOutlet weak var name: UILabel! 7 @IBOutlet weak var handle: UILabel! 8 @IBOutlet weak var whiteText: UITextView! 9 @IBOutlet weak var blackText: UITextView! 10 11 12 override public func awakeFromNib() { 13 super.awakeFromNib() 14 // Initialization code 15 } 16 17 public func configure(profilePic:String?,name:String,handle:String,whiteText:String,blackText:String) 18 { 19 self.whiteText.text = whiteText 20 self.blackText.text = blackText 21 self.handle.text = "@"+handle 22 self.name.text = name 23 24 if((profilePic) != nil) 25 26 { 27 let imageData = NSData(contentsOf:URL(string:profilePic!)!) 28 29 self.profilePic.image = UIImage(data:imageData! as Data) 30 } 31 else 32 { 33 self.profilePic.image = UIImage(named:"twitter") 34 } 35 } 36 37}
あなたの回答
tips
プレビュー