質問編集履歴
3
情報の追加、改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,12 +20,94 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
```Swift
|
24
|
-
|
25
23
|
import UIKit
|
26
24
|
|
27
25
|
|
28
26
|
|
27
|
+
@UIApplicationMain
|
28
|
+
|
29
|
+
class AppDelegate: UIResponder, UIApplicationDelegate { // Thread 1:signal SIGABRT
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
var window: UIWindow?
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
40
|
+
|
41
|
+
// Override point for customization after application launch.
|
42
|
+
|
43
|
+
return true
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
func applicationWillResignActive(_ application: UIApplication) {
|
50
|
+
|
51
|
+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
52
|
+
|
53
|
+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
func applicationDidEnterBackground(_ application: UIApplication) {
|
60
|
+
|
61
|
+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
62
|
+
|
63
|
+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
func applicationWillEnterForeground(_ application: UIApplication) {
|
70
|
+
|
71
|
+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
func applicationDidBecomeActive(_ application: UIApplication) {
|
78
|
+
|
79
|
+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
func applicationWillTerminate(_ application: UIApplication) {
|
86
|
+
|
87
|
+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
```
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
### エラーが出ていない部分のソースコード
|
104
|
+
|
105
|
+
```ここに言語を入力
|
106
|
+
|
107
|
+
import UIKit
|
108
|
+
|
109
|
+
|
110
|
+
|
29
111
|
|
30
112
|
|
31
113
|
var nakami = [String]()
|
@@ -118,89 +200,109 @@
|
|
118
200
|
|
119
201
|
|
120
202
|
|
203
|
+
```ここに言語を入力
|
204
|
+
|
205
|
+
import UIKit
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource{
|
210
|
+
|
211
|
+
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
return nakami.count
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
222
|
+
|
223
|
+
let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
cell.textLabel!.text = nakami[indexPath.row]
|
228
|
+
|
229
|
+
return cell
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
override func viewDidLoad() {
|
240
|
+
|
241
|
+
super.viewDidLoad()
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
if UserDefaults.standard.object(forKey: "ToDoList") != nil {
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
nakami = UserDefaults.standard.object(forKey: "ToDoList") as! [String]
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
override func didReceiveMemoryWarning() {
|
272
|
+
|
273
|
+
super.didReceiveMemoryWarning()
|
274
|
+
|
275
|
+
// Dispose of any resources that can be recreated.
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
}
|
284
|
+
|
121
285
|
```
|
122
286
|
|
123
|
-
|
287
|
+
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
288
|
+
|
128
|
-
|
129
|
-
|
289
|
+
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
290
|
+
|
134
|
-
|
135
|
-
|
291
|
+
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
292
|
+
|
140
|
-
|
141
|
-
|
293
|
+
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
294
|
+
|
146
|
-
|
147
|
-
|
295
|
+
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
296
|
+
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
297
|
+
|
158
|
-
|
159
|
-
|
298
|
+
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
299
|
+
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
300
|
+
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
301
|
+
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
302
|
+
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
303
|
+
|
190
|
-
|
191
|
-
|
304
|
+
|
192
|
-
|
193
|
-
|
305
|
+
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
}
|
202
|
-
|
203
|
-
```
|
204
306
|
|
205
307
|
|
206
308
|
|
2
文の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -214,6 +214,8 @@
|
|
214
214
|
|
215
215
|
検索して解決方法を色々調べたのですが、解決できませんでした。
|
216
216
|
|
217
|
+
初心者なので質問も至らない点があるかと思います。すみません。もし不足している情報があれば迅速に追加します。
|
218
|
+
|
217
219
|
|
218
220
|
|
219
221
|
### 補足情報(FW/ツールのバージョンなど)
|
1
初心者マークの追加、文字の修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|