質問するログイン新規登録

回答編集履歴

1

コード追記

2019/08/15 13:50

投稿

toki_td
toki_td

スコア2850

answer CHANGED
@@ -8,4 +8,14 @@
8
8
 
9
9
  あと、これとは関係ないですが、cellForRowAtでdequeueReuseableCellで取得した変数を捨てて、そのあとにメンバ変数のcellに値を設定していますが、もしかしてcellをreturnしていませんか?これはうまくいきません。
10
10
  dequeueReusableCellで取得したセルを返すようにしてください。
11
- staticなUITableViewでない限り、ほとんどのケースでUITableViewがメンバ変数になることはないはずです。(その設計は大抵潜在的な問題があります)
11
+ staticなUITableViewでない限り、ほとんどのケースでUITableViewがメンバ変数になることはないはずです。(その設計は大抵潜在的な問題があります)
12
+
13
+ **追記**
14
+ ```Swift
15
+ func tableView(_ tableView: UITableView, cellForRowAt indexPath:IndexPath) -> UITableViewCell
16
+ {
17
+ let cell = tableView.dequeueReusableCell(withIdentifier:"cell", for:indexPath)
18
+ cell.textLabel!.text = TODO[indexPath.row]
19
+ return cell
20
+ }
21
+ ```