質問編集履歴

5

質問内容の編集

2021/05/28 02:22

投稿

quwant
quwant

スコア5

test CHANGED
File without changes
test CHANGED
@@ -110,8 +110,8 @@
110
110
 
111
111
  ▼参照サイト
112
112
 
113
- [【SwiftUI】Likeボタンとリスト内セルにボタンを実装する場合の注意点
113
+ 1、[【SwiftUI】Likeボタンとリスト内セルにボタンを実装する場合の注意点
114
114
 
115
115
  ](https://qiita.com/m37335/items/66f59135e98c2b206a36)
116
116
 
117
- [Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed](https://stackoverflow.com/questions/64029844/strange-error-nw-protocol-get-quic-image-block-invoke-dlopen-libquic-failed)
117
+ 2、[Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed](https://stackoverflow.com/questions/64029844/strange-error-nw-protocol-get-quic-image-block-invoke-dlopen-libquic-failed)

4

質問内容の編集

2021/05/28 02:22

投稿

quwant
quwant

スコア5

test CHANGED
File without changes
test CHANGED
@@ -105,3 +105,13 @@
105
105
  result >>> {"cause":"BUSINESS_ERROR","errors":[{"field":"_global","code":"FORBIDDEN","data":{}}]}
106
106
 
107
107
  ```
108
+
109
+
110
+
111
+ ▼参照サイト
112
+
113
+ [【SwiftUI】Likeボタンとリスト内セルにボタンを実装する場合の注意点
114
+
115
+ ](https://qiita.com/m37335/items/66f59135e98c2b206a36)
116
+
117
+ [Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed](https://stackoverflow.com/questions/64029844/strange-error-nw-protocol-get-quic-image-block-invoke-dlopen-libquic-failed)

3

ソースの編集

2021/05/28 02:19

投稿

quwant
quwant

スコア5

test CHANGED
File without changes
test CHANGED
@@ -19,6 +19,8 @@
19
19
 
20
20
 
21
21
  ```Swift
22
+
23
+ class SendReqest {
22
24
 
23
25
  func sendReqest(_ methodType: String, _ urlString: String, _ headers: Dictionary<String, String>){
24
26
 
@@ -42,7 +44,9 @@
42
44
 
43
45
 
44
46
 
45
- let task = URLSession.shared.dataTask(with: reqestUrl, completionHandler: {data, response, error in
47
+ // let task = URLSession.shared.dataTask(with: reqestUrl, completionHandler: {data, response, error in
48
+
49
+ let task = URLSession.shared.dataTask(with: reqestUrl){(data, response, error) in
46
50
 
47
51
  if (error == nil) {
48
52
 
@@ -78,13 +82,15 @@
78
82
 
79
83
  }
80
84
 
85
+ // })
86
+
81
- })
87
+ }
82
88
 
83
89
  task.resume()
84
90
 
85
91
  }
86
92
 
87
-
93
+ }
88
94
 
89
95
  ```
90
96
 

2

ソースの編集

2021/05/28 02:06

投稿

quwant
quwant

スコア5

test CHANGED
File without changes
test CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  if (error == nil) {
48
48
 
49
- guard let data = data else {
49
+ guard let _data = data else {
50
50
 
51
51
  print("SendReqest guard")
52
52
 
@@ -54,17 +54,27 @@
54
54
 
55
55
  }
56
56
 
57
- DispatchQueue.main.async {
57
+ if let result = String(data: _data, encoding: .utf8) {
58
58
 
59
- let result = String(data: data, encoding: .utf8)!
60
-
61
- print("result (result)")
59
+ print("result >>> (result)")
62
60
 
63
61
  }
64
62
 
63
+ // DispatchQueue.main.async {
64
+
65
+ // let result = String(data: data!, encoding: .utf8)!
66
+
67
+ // print("result >>> (result)")
68
+
69
+ // }
70
+
65
71
  } else {
66
72
 
73
+ let statusCode = (response as! HTTPURLResponse).statusCode
74
+
67
- print("error")
75
+ print("StatusCode >>> (statusCode)")
76
+
77
+ print("Error >>> (String(describing: error))")
68
78
 
69
79
  }
70
80
 
@@ -80,30 +90,12 @@
80
90
 
81
91
 
82
92
 
83
- ▼エラー
93
+ ▼エラーログ
84
94
 
85
95
  ```
86
96
 
87
- 2021-05-28 09:58:37.532901+0900 ShowJsonApp[973:58792] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
97
+ 2021-05-28 10:43:50.128307+0900 ShowJsonApp[1448:90011] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
88
98
 
89
- 2021-05-28 09:58:37.535900+0900 ShowJsonApp[973:58792] [connection] nw_socket_handle_socket_event [C1.1:3] Socket SO_ERROR [61: Connection refused]
90
-
91
- 2021-05-28 09:58:37.544149+0900 ShowJsonApp[973:58792] [connection] nw_socket_handle_socket_event [C1.2:3] Socket SO_ERROR [61: Connection refused]
92
-
93
- 2021-05-28 09:58:37.546976+0900 ShowJsonApp[973:58792] Connection 1: received failure notification
94
-
95
- 2021-05-28 09:58:37.547573+0900 ShowJsonApp[973:58792] Connection 1: failed to connect 1:61, reason -1
96
-
97
- 2021-05-28 09:58:37.547775+0900 ShowJsonApp[973:58792] Connection 1: encountered error(1:61)
98
-
99
- 2021-05-28 09:58:37.551342+0900 ShowJsonApp[973:58792] Task <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
100
-
101
- 2021-05-28 09:58:37.561006+0900 ShowJsonApp[973:58445] Task <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x6000013e58f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
102
-
103
- "LocalDataTask <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1>"
104
-
105
- ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://localhost/, NSErrorFailingURLKey=https://localhost/, _kCFStreamErrorDomainKey=1}
106
-
107
-
99
+ result >>> {"cause":"BUSINESS_ERROR","errors":[{"field":"_global","code":"FORBIDDEN","data":{}}]}
108
100
 
109
101
  ```

1

質問内容の編集

2021/05/28 01:51

投稿

quwant
quwant

スコア5

test CHANGED
File without changes
test CHANGED
@@ -77,3 +77,33 @@
77
77
 
78
78
 
79
79
  ```
80
+
81
+
82
+
83
+ ▼エラー文
84
+
85
+ ```
86
+
87
+ 2021-05-28 09:58:37.532901+0900 ShowJsonApp[973:58792] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
88
+
89
+ 2021-05-28 09:58:37.535900+0900 ShowJsonApp[973:58792] [connection] nw_socket_handle_socket_event [C1.1:3] Socket SO_ERROR [61: Connection refused]
90
+
91
+ 2021-05-28 09:58:37.544149+0900 ShowJsonApp[973:58792] [connection] nw_socket_handle_socket_event [C1.2:3] Socket SO_ERROR [61: Connection refused]
92
+
93
+ 2021-05-28 09:58:37.546976+0900 ShowJsonApp[973:58792] Connection 1: received failure notification
94
+
95
+ 2021-05-28 09:58:37.547573+0900 ShowJsonApp[973:58792] Connection 1: failed to connect 1:61, reason -1
96
+
97
+ 2021-05-28 09:58:37.547775+0900 ShowJsonApp[973:58792] Connection 1: encountered error(1:61)
98
+
99
+ 2021-05-28 09:58:37.551342+0900 ShowJsonApp[973:58792] Task <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
100
+
101
+ 2021-05-28 09:58:37.561006+0900 ShowJsonApp[973:58445] Task <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x6000013e58f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
102
+
103
+ "LocalDataTask <B52841C6-56EA-46B6-BA1F-6F2274D8672B>.<1>"
104
+
105
+ ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://localhost/, NSErrorFailingURLKey=https://localhost/, _kCFStreamErrorDomainKey=1}
106
+
107
+
108
+
109
+ ```