質問編集履歴
2
labelの表示コード修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! CollectionViewCell2
|
32
32
|
cell.label1.text = foodNameArray[indexPath.row]
|
33
33
|
// 表示されないラベルは以下
|
34
|
-
cell.label2.text = priceArray[indexPath.row]
|
34
|
+
cell.label2.text = String(priceArray[indexPath.row])
|
35
35
|
cell.btn1.tag = indexPath.row
|
36
36
|
cell.setCell()
|
37
37
|
return cell
|
1
配列名の変更忘れと、アプリが落ちることの具体的な説明を追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
以前下記リンクのような質問をさせていただきました。
|
6
6
|
https://teratail.com/questions/199897
|
7
7
|
|
8
|
-
この質問にいただいた回答を基に、Firestore内に入れているInt型のデータをラベルに表示するコードを以下のように書いたのですが、
|
8
|
+
この質問にいただいた回答を基に、Firestore内に入れているInt型のデータをラベルに表示するコードを以下のように書いたのですが、実行するとアプリが落ちてしまいます。
|
9
|
+
|
9
10
|
なお、Firestoreには
|
10
11
|
- 食品名(String)
|
11
12
|
- メーカー名(String)
|
@@ -30,7 +31,7 @@
|
|
30
31
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! CollectionViewCell2
|
31
32
|
cell.label1.text = foodNameArray[indexPath.row]
|
32
33
|
// 表示されないラベルは以下
|
33
|
-
cell.label2.text =
|
34
|
+
cell.label2.text = priceArray[indexPath.row]
|
34
35
|
cell.btn1.tag = indexPath.row
|
35
36
|
cell.setCell()
|
36
37
|
return cell
|