質問編集履歴
1
情報の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,81 +1,9 @@
|
|
1
1
|
WebViewでブラウザのページを表示させたく、かつキャッシュが残らないようにしたいので以下のようにコードを書きました。
|
2
2
|
|
3
|
-
|
3
|
+
メソッドの中にfor~のコードを写したら以下のようなエラーが出ました。
|
4
4
|
|
5
|
-
import UIKit
|
6
|
-
|
7
|
-
|
5
|
+
![イメージ説明](fa0fc9ca1d64f6aceb5fe583cbaa581f.png)
|
8
6
|
|
9
7
|
|
10
8
|
|
11
|
-
class ViewController: UIViewController,UIWebViewDelegate {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
@IBOutlet weak var webBrowser: UIWebView!
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
override func viewDidLoad() {
|
20
|
-
|
21
|
-
super.viewDidLoad()
|
22
|
-
|
23
|
-
let url = NSURL(string:"http://127.0.0.1:8000/admin/accounts/")
|
24
|
-
|
25
|
-
let request = NSURLRequest(url:url! as URL)
|
26
|
-
|
27
|
-
self.webBrowser.delegate = self
|
28
|
-
|
29
|
-
self.webBrowser.loadRequest(request as URLRequest)
|
30
|
-
|
31
|
-
URLCache.shared.removeAllCachedResponses()
|
32
|
-
|
33
|
-
URLCache.shared.diskCapacity = 0
|
34
|
-
|
35
|
-
URLCache.shared.memoryCapacity = 0
|
36
|
-
|
37
|
-
// Do any additional setup after loading the view, typically from a nib.
|
38
|
-
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
|
9
|
+
どう直せば良いのでしょうか?
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
override func didReceiveMemoryWarning() {
|
56
|
-
|
57
|
-
super.didReceiveMemoryWarning()
|
58
|
-
|
59
|
-
// Dispose of any resources that can be recreated.
|
60
|
-
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
for (key, value) in ProcessInfo.processInfo.environment {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
print("\(OS_ACTIVITY_MODE ): \(${DEBUG_ACTIVITY_MODE})")
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
```
|
80
|
-
|
81
|
-
for (key, value) ~の行でExpected declaration とエラーが出ました。これは定義する方法が間違っているということなのでしょうか?どう直せばよいのでしょうか?
|