テーブルビューのセルにテキストを入れる部分です。
「UITableViewCell」をインスタンスする部分()
let cell = UITableViewCell(style: UITableViewCellStyle, reuseIdentifier: "cell")
上記で、UITableViewCellStyle型がおかしい?のようなエラーメッセージが出ます。
公式ドキュメントのinti通りに書いたつもりですが、一体どこが原因でしょうか??
Swift
1 // (テーブルの)セルにテキストを代入。 2 func tableView(tableView: UITableView, cellForRowAtindexPath indexPath: NSIndexPath) -> UITableViewCell { 3 let cell = UITableViewCell(style: UITableViewCellStyle, reuseIdentifier: "cell") 4 let article = articles[(indexPath as NSIndexPath).row] 5 cell.textLabel?.text = article["title"] as? String 6 cell.detailTextLabel?.text = article["display_name"] as? String 7 return cell 8 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/18 12:05