回答編集履歴

1

コード修正

2017/09/08 10:17

投稿

simorgh3196
simorgh3196

スコア157

test CHANGED
@@ -16,7 +16,19 @@
16
16
 
17
17
  let seconds = dataList2[pickerView.selectedRow(inComponent: 1)]
18
18
 
19
+
20
+
21
+ // 修正前:
22
+
23
+ // time = minutes * 60 + seconds
24
+
25
+
26
+
27
+ // 修正後:
28
+
29
+ // 簡単のためにforce castしてますが,ちゃんとオプショナルチェックした方がいいです
30
+
19
- time = minutes * 60 + seconds
31
+ time = Int(minutes)! * 60 + Int(seconds)!
20
32
 
21
33
 
22
34