-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
488 lines (243 loc) · 117 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>🅱️an</title>
<subtitle>这是一个工作博客</subtitle>
<link href="http://example.com/atom.xml" rel="self"/>
<link href="http://example.com/"/>
<updated>2022-05-08T06:42:05.853Z</updated>
<id>http://example.com/</id>
<author>
<name>班殿宏</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>3个你应该知道的暗网网站</title>
<link href="http://example.com/2022/05/08/3%E4%B8%AA%E4%BD%A0%E5%BA%94%E8%AF%A5%E7%9F%A5%E9%81%93%E7%9A%84%E6%9A%97%E7%BD%91%E7%BD%91%E7%AB%99/"/>
<id>http://example.com/2022/05/08/3%E4%B8%AA%E4%BD%A0%E5%BA%94%E8%AF%A5%E7%9F%A5%E9%81%93%E7%9A%84%E6%9A%97%E7%BD%91%E7%BD%91%E7%AB%99/</id>
<published>2022-05-08T06:37:20.000Z</published>
<updated>2022-05-08T06:42:05.853Z</updated>
<content type="html"><![CDATA[<p>知道tor的朋友应该都不陌生,以下推荐三个暗网网站。</p><p>1、The Hidden Wiki</p><p>网址:<a href="http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/">http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion</a></p><p>这是一个很好的暗网入口网站,里面内容保罗万象,甚至是一个权威的暗网网站。</p><p>2、TG</p><p>网址:<a href="http://galaxy3yrfbwlwo72q3v2wlyjinqr2vejgpkxb22ll5pcpuaxlnqjiid.onion/">http://galaxy3yrfbwlwo72q3v2wlyjinqr2vejgpkxb22ll5pcpuaxlnqjiid.onion/</a></p><p>全名Torrent Galaxy,顾名思义,这是一个torrent资源站点。如果你是个影视影视爱好者,这里一定是你的最爱。</p><p>3、Mail2tor</p><p><a href="http://mail2torjgmxgexntbrmhvgluavhj7ouul5yar6ylbvjkxwqf6ixkwyd.onion/"><strong>http://mail2torjgmxgexntbrmhvgluavhj7ouul5yar6ylbvjkxwqf6ixkwyd.onion</strong></a></p><p>这是一个功能很好的匿名邮箱,能和普通邮箱进行通信。</p>]]></content>
<summary type="html"><p>知道tor的朋友应该都不陌生,以下推荐三个暗网网站。</p>
<p>1、The Hidden Wiki</p>
<p>网址:<a href="http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.on</summary>
<category term="暗网" scheme="http://example.com/tags/%E6%9A%97%E7%BD%91/"/>
</entry>
<entry>
<title>如何抄底</title>
<link href="http://example.com/2022/04/26/%E5%A6%82%E4%BD%95%E6%8A%84%E5%BA%95/"/>
<id>http://example.com/2022/04/26/%E5%A6%82%E4%BD%95%E6%8A%84%E5%BA%95/</id>
<published>2022-04-26T06:40:11.000Z</published>
<updated>2022-04-26T07:40:53.383Z</updated>
<content type="html"><![CDATA[<h3 id="抄底的前提"><a href="#抄底的前提" class="headerlink" title="抄底的前提"></a>抄底的前提</h3><p>有主力在里面。</p><p>有时候主力会借助大盘杀跌来获取低价筹码,然后再把股价拉回支撑线。所以,抄底是建立在主力控盘的情况下进行的。</p><h3 id="例子"><a href="#例子" class="headerlink" title="例子"></a>例子</h3><p>以下我列举了一个短期抄底的例子。</p><p><img src="https://s1.imagehub.cc/images/2022/04/26/c956b84ccd684e288c895062130b560e.png" alt="抄底追踪"></p><p>上图可以看出,主力资金在支撑线上开始建仓,每次回调都是缩量,目的就是为了获得更便宜的筹码。</p><p><img src="https://s1.imagehub.cc/images/2022/04/26/fd8a89c3489937380d2045ca44e905ea.png" alt="抄底分时线"></p><p>抄底并不是下跌了就买,就算是有主力控盘,你也不能立马确定是不是出货行为。所以,确定能不能抄底需要主力把价格拉回一定位置并且不能再放量下跌。只有这样我们才能确定主力只是在洗盘并不是在出货。我们的抄底并不是买在底部,而是买在一个相对安全的位置,跟随主力吸筹。</p>]]></content>
<summary type="html"><h3 id="抄底的前提"><a href="#抄底的前提" class="headerlink" title="抄底的前提"></a>抄底的前提</h3><p>有主力在里面。</p>
<p>有时候主力会借助大盘杀跌来获取低价筹码,然后再把股价拉回支撑线。所以,抄底是建立在主力</summary>
<category term="抄底" scheme="http://example.com/tags/%E6%8A%84%E5%BA%95/"/>
</entry>
<entry>
<title>如何用tor浏览器科学上网</title>
<link href="http://example.com/2022/02/26/%E5%A6%82%E4%BD%95%E7%94%A8tor%E6%B5%8F%E8%A7%88%E5%99%A8%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/"/>
<id>http://example.com/2022/02/26/%E5%A6%82%E4%BD%95%E7%94%A8tor%E6%B5%8F%E8%A7%88%E5%99%A8%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/</id>
<published>2022-02-26T02:45:22.000Z</published>
<updated>2022-02-26T03:02:31.560Z</updated>
<content type="html"><![CDATA[<h2 id="思路"><a href="#思路" class="headerlink" title="思路"></a>思路</h2><p>本文旨在使用国外免费服务器配合洋葱浏览器免费科学上网。</p><h2 id="Tor浏览器下载"><a href="#Tor浏览器下载" class="headerlink" title="Tor浏览器下载"></a>Tor浏览器下载</h2><p>下载地址:<a href="https://www.torproject.org/">Tor浏览器</a></p><h2 id="免费服务器地址:"><a href="#免费服务器地址:" class="headerlink" title="免费服务器地址:"></a>免费服务器地址:</h2><p>地址1:<a href="https://proxy.mimvp.com/freeopen?proxy=out_socks">https://proxy.mimvp.com/freeopen?proxy=out_socks</a></p><p>地址2:<a href="https://community.torproject.org/">https://community.torproject.org/</a></p><h2 id="设置浏览器代理"><a href="#设置浏览器代理" class="headerlink" title="设置浏览器代理"></a>设置浏览器代理</h2><p>打开tor浏览器,找到设置里的服务器设置,把免费浏览器设置到代理里。如图:</p><p><img src="https://s1.imagehub.cc/images/2022/02/26/image.png"></p><p><img src="https://s1.imagehub.cc/images/2022/02/26/image9b2736eb2f41ff75.png"></p><p><img src="https://s1.imagehub.cc/images/2022/02/26/image3be2f9da8bdf7cdd.png"></p><p>连接成功以后就可以了。</p>]]></content>
<summary type="html"><h2 id="思路"><a href="#思路" class="headerlink" title="思路"></a>思路</h2><p>本文旨在使用国外免费服务器配合洋葱浏览器免费科学上网。</p>
<h2 id="Tor浏览器下载"><a href="#Tor浏览器下载" </summary>
<category term="tor 洋葱浏览器 科学上网" scheme="http://example.com/tags/tor-%E6%B4%8B%E8%91%B1%E6%B5%8F%E8%A7%88%E5%99%A8-%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/"/>
</entry>
<entry>
<title>企业证书生成</title>
<link href="http://example.com/2021/12/08/%E4%BC%81%E4%B8%9A%E8%AF%81%E4%B9%A6%E7%94%9F%E6%88%90/"/>
<id>http://example.com/2021/12/08/%E4%BC%81%E4%B8%9A%E8%AF%81%E4%B9%A6%E7%94%9F%E6%88%90/</id>
<published>2021-12-08T03:05:32.000Z</published>
<updated>2021-12-08T03:17:34.167Z</updated>
<content type="html"><![CDATA[<p>本文只介绍发布证书的生成,开发证书生成类似。</p><p>1、Certificates</p><p>New -> In-House and Ad Hoc -> Choose File -> Done</p><p>2、Identifiers</p><p>New -> App IDs -> Register an App ID -> Done</p><p>注意,Deployment Details根据情况勾选。如图:</p><p><img src="https://img.wenhairu.com/images/2021/12/08/pD9Es.png" alt="image-20211208111328979"></p><p>3、Profiles</p><p>New -> In House -> Select an App ID -> Select Certificates -> Review, Name and Generate -> Done</p><p>另:VPN签名证书生成类似,但不可使用发布证书做VPN签名。</p>]]></content>
<summary type="html"><p>本文只介绍发布证书的生成,开发证书生成类似。</p>
<p>1、Certificates</p>
<p>New -&gt; In-House and Ad Hoc -&gt; Choose File -&gt; Done</p>
<p>2、Identifiers</p>
<</summary>
<category term="企业证书" scheme="http://example.com/tags/%E4%BC%81%E4%B8%9A%E8%AF%81%E4%B9%A6/"/>
</entry>
<entry>
<title>mac 如何暴利破解wifi密码</title>
<link href="http://example.com/2021/10/11/mac-%E5%A6%82%E4%BD%95%E6%9A%B4%E5%88%A9%E7%A0%B4%E8%A7%A3wifi%E5%AF%86%E7%A0%81/"/>
<id>http://example.com/2021/10/11/mac-%E5%A6%82%E4%BD%95%E6%9A%B4%E5%88%A9%E7%A0%B4%E8%A7%A3wifi%E5%AF%86%E7%A0%81/</id>
<published>2021-10-11T01:56:04.000Z</published>
<updated>2021-10-11T04:34:33.991Z</updated>
<content type="html"><![CDATA[<p>准备工具:</p><p><a href="http://www.aircrack-ng.org/downloads.html">aircrack-ng</a></p><p>步骤</p><p>1、下载源码编译。</p><p><a href="https://github.com/aircrack-ng/aircrack-ng">https://github.com/aircrack-ng/aircrack-ng</a></p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">Compiling on OS X with macports (and all options):</span><br><span class="line"></span><br><span class="line">./configure --with-experimental</span><br><span class="line">gmake</span><br><span class="line">Compiling on macOS running on M1/AARCH64 and Homebrew:</span><br><span class="line"></span><br><span class="line">autoreconf -vif</span><br><span class="line">env CPPFLAGS="-Wno-deprecated-declarations" ./configure --with-experimental</span><br><span class="line">make</span><br><span class="line">make check</span><br></pre></td></tr></table></figure><p>2、教程</p><p><a href="https://www.cnblogs.com/halberd-lee/p/11400347.html">https://www.cnblogs.com/halberd-lee/p/11400347.html</a></p><p><a href="https://chaishiwei.com/blog/562.html">https://chaishiwei.com/blog/562.html</a></p><p>3、爆破字典</p><p><a href="https://github.com/rootphantomer/Blasting_dictionary">https://github.com/rootphantomer/Blasting_dictionary</a></p>]]></content>
<summary type="html"><p>准备工具:</p>
<p><a href="http://www.aircrack-ng.org/downloads.html">aircrack-ng</a></p>
<p>步骤</p>
<p>1、下载源码编译。</p>
<p><a href="https://githu</summary>
<category term="wifi破解" scheme="http://example.com/tags/wifi%E7%A0%B4%E8%A7%A3/"/>
</entry>
<entry>
<title>Kontakt 6如何加载库</title>
<link href="http://example.com/2021/10/11/Kontakt-6%E5%A6%82%E4%BD%95%E5%8A%A0%E8%BD%BD%E5%BA%93/"/>
<id>http://example.com/2021/10/11/Kontakt-6%E5%A6%82%E4%BD%95%E5%8A%A0%E8%BD%BD%E5%BA%93/</id>
<published>2021-10-11T01:24:53.000Z</published>
<updated>2021-10-11T01:41:48.098Z</updated>
<content type="html"><![CDATA[<p>本篇文章仅适用于Mac电脑。</p><p><strong>准备文件:</strong></p><p><a href="https://www.native-instruments.com/zh/specials/native-access/">Native Access</a></p><p><a href="https://pirate-proxy.cam/description.php?id=35141327">Kontakt 6</a></p><p><a href="https://pirate-proxy.cam/description.php?id=15829688">Kontakt 5</a></p><p>音源文件库</p><p><strong>步骤:</strong></p><p>1、安装Native Access,安装好了以后运行。</p><p>1、安装Kontakt 6,并安装更新。</p><p>2、解压Kontakt 5压缩包,解压里面的crack压缩包,复制里面的kontakt 5到应用程序里跟kontakt 6放在同一级目录:</p><p>【应用程序】->【Navitive Instruments】->【Kontakt】</p><p>3、加载音源库。因为kontakt 6不能加载外部音源库,所以要用kontakt 5加载。先运行kontakt 5,进入页面后点击[Libraries]->[Add Library]。选择你的音源库。点击打开就安装好了。打开kontakt 6就可以在【Libraries】里看到安装好的音源库。</p><p><strong>音源库目录结构,例如:Ashlight</strong></p><ul><li>Ashlight.nicnt</li><li>Documentation</li><li>Instruments</li><li>Samples</li><li>Snapshots</li></ul><p>-</p>]]></content>
<summary type="html"><p>本篇文章仅适用于Mac电脑。</p>
<p><strong>准备文件:</strong></p>
<p><a href="https://www.native-instruments.com/zh/specials/native-access/">Native Access</summary>
<category term="kontakt6" scheme="http://example.com/tags/kontakt6/"/>
</entry>
<entry>
<title>如何用freessl获得nginx https证书</title>
<link href="http://example.com/2021/09/12/%E5%A6%82%E4%BD%95%E7%94%A8freessl%E8%8E%B7%E5%BE%97nginx-https%E8%AF%81%E4%B9%A6/"/>
<id>http://example.com/2021/09/12/%E5%A6%82%E4%BD%95%E7%94%A8freessl%E8%8E%B7%E5%BE%97nginx-https%E8%AF%81%E4%B9%A6/</id>
<published>2021-09-11T16:02:09.000Z</published>
<updated>2021-10-11T01:55:10.729Z</updated>
<content type="html"><![CDATA[<p><a href="https://freessl.cn/login">https://freessl.cn/login</a></p><p>注册登录</p><img src="https://img.wenhairu.com/images/2021/10/11/1REaB.png" alt="image-20210912000403652" style="zoom:50%;" /><img src="https://img.wenhairu.com/images/2021/10/11/1RUPn.png" alt="image-20210912000454384" style="zoom:50%;" /><img src="https://img.wenhairu.com/images/2021/10/11/1RazA.png" style="zoom:50%;" /><img src="https://img.wenhairu.com/images/2021/10/11/1R9JT.jpg" alt="image-20210912000551121" style="zoom:50%;" /><p>没有下载KeyManager的先下载,下载完了打开,设置好密码。从KeyManager生成证书预览后回到浏览器点击继续,然后。</p><img src="https://img.wenhairu.com/images/2021/10/11/1RGoG.png" alt="image-20210912002042628" style="zoom:50%;" /><p>到域名解析服务商那里填写这些值并开启</p><img src="https://img.wenhairu.com/images/2021/10/11/1R1dv.png" alt="image-20210912002231861" style="zoom:50%;" /><p>到这个网站去测试是否已经成功:<a href="https://myssl.com/dns_check.html?domain=jihejingjia.cn&brand=2&type=2&txt=KCJcZbY8avWx3a8pFmqk9nOhNlgP_Hs5jBJyPtHCh74#ssl_verify">https://myssl.com/dns_check.html?domain=jihejingjia.cn&brand=2&type=2&txt=KCJcZbY8avWx3a8pFmqk9nOhNlgP_Hs5jBJyPtHCh74#ssl_verify</a></p><img src="https://img.wenhairu.com/images/2021/10/11/1R5F0.png" alt="image-20210912002335763" style="zoom:50%;" /><p>在KeyManager上申请。</p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RnnU.png" alt="image-20210912001013881"></p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RyTj.png" alt="image-20210912001050031"></p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RHxg.png" alt="image-20210912001152732"></p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RRuK.png" alt="image-20210912001213682"></p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RkP3.png" alt="image-20210912001250887"></p><p>nginx配置</p><p>把上面导出的两个文件放到服务器一个目录下</p><img src="https://img.wenhairu.com/images/2021/10/11/1Rozo.png" alt="image-20210912002539813" style="zoom:50%;" /><p>配置nginx.conf文件</p><p><img src="https://img.wenhairu.com/images/2021/10/11/1RSKf.png" alt="image-20210912002630849"></p><p>重启nginx</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">pkill -9 nginx</span><br><span class="line">/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf</span><br></pre></td></tr></table></figure><p>参考:<a href="https://www.cnblogs.com/wangcp-2014/p/9922845.html">https://www.cnblogs.com/wangcp-2014/p/9922845.html</a></p>]]></content>
<summary type="html"><p><a href="https://freessl.cn/login">https://freessl.cn/login</a></p>
<p>注册登录</p>
<img src="https://img.wenhairu.com/images/2021/10/11/1REa</summary>
<category term="freessl https" scheme="http://example.com/tags/freessl-https/"/>
</entry>
<entry>
<title>苹果企业级开发者证书申请流程</title>
<link href="http://example.com/2021/09/02/%E8%8B%B9%E6%9E%9C%E4%BC%81%E4%B8%9A%E7%BA%A7%E5%BC%80%E5%8F%91%E8%80%85%E8%AF%81%E4%B9%A6%E7%94%B3%E8%AF%B7%E6%B5%81%E7%A8%8B/"/>
<id>http://example.com/2021/09/02/%E8%8B%B9%E6%9E%9C%E4%BC%81%E4%B8%9A%E7%BA%A7%E5%BC%80%E5%8F%91%E8%80%85%E8%AF%81%E4%B9%A6%E7%94%B3%E8%AF%B7%E6%B5%81%E7%A8%8B/</id>
<published>2021-09-02T04:31:48.000Z</published>
<updated>2021-10-11T01:54:59.713Z</updated>
<content type="html"><![CDATA[<h2 id="一、准备资料"><a href="#一、准备资料" class="headerlink" title="一、准备资料"></a>一、准备资料</h2><hr><p>1、企业/政府机构信息</p><table><thead><tr><th><strong>企业/政府机构实体名称(英文)</strong></th></tr></thead><tbody><tr><td><strong>企业/政府机构官方网址</strong></td></tr><tr><td><strong>电话号码</strong></td></tr><tr><td><strong>企业/政府机构所在地址(英文和中文) (市/镇、州/省)</strong></td></tr><tr><td><strong>企业/政府机构关联的邮箱(常说的带企业域名的邮箱)</strong></td></tr><tr><td><em>邓白氏编码(企业必须,政府机构非必须)</em></td></tr><tr><td><strong>邮政编码</strong></td></tr><tr><td><strong>员工人数</strong></td></tr></tbody></table><p>2、账户持有人/负责人信息</p><table><thead><tr><th>姓名</th></tr></thead><tbody><tr><td><strong>身份证号码</strong></td></tr><tr><td><strong>联系号码</strong></td></tr><tr><td><strong>住址(市/镇、州/省)</strong></td></tr><tr><td><strong>人脸识别</strong></td></tr><tr><td><strong>电子邮箱</strong></td></tr><tr><td><strong>邮政编码</strong></td></tr></tbody></table><h2 id="二、Apple-ID申请及双重认证"><a href="#二、Apple-ID申请及双重认证" class="headerlink" title="二、Apple ID申请及双重认证"></a>二、Apple ID申请及双重认证</h2><hr><p>账户持有人/负责人需要使用企业/政府机构关联的邮箱申请Apple ID,并完成双重认证。</p><p>Apple ID申请地址:<a href="https://appleid.apple.com/account">https://appleid.apple.com/account</a></p><p>双重认证参考:<a href="https://support.apple.com/zh-cn/HT204915">https://support.apple.com/zh-cn/HT204915</a></p><h2 id="三、验证身份"><a href="#三、验证身份" class="headerlink" title="三、验证身份"></a>三、验证身份</h2><hr><p>在进行企业级开发者证书申请之前,需要账户持有人验证身份。在通过验证后,该身份将与账户持有人的 Apple ID 相关联,并且无法通过登录其他 Apple ID 来再次验证。</p><ul><li><p>验证身份之前需要在苹果设备(iPhone或者iPad)上登陆即将用来申请企业级开发者账号的Apple ID,并且开启双重认证,且手机必须设置好锁屏密码。</p></li><li><p>到苹果商店下载应用:<a href="https://apps.apple.com/cn/app/wwdc/id640199958">Apple Developer</a>。使用Apple Developer验证账户持有人的身份。</p></li></ul><p>验证详细流程参考说明:<a href="https://blog.csdn.net/lianai911/article/details/107975066">https://blog.csdn.net/lianai911/article/details/107975066</a></p><p>官方文档:<a href="https://developer.apple.com/cn/support/app-account/#verify">https://developer.apple.com/cn/support/app-account/#verify</a></p><h2 id="四、打电话给苹果技术顾问"><a href="#四、打电话给苹果技术顾问" class="headerlink" title="四、打电话给苹果技术顾问"></a>四、打电话给苹果技术顾问</h2><hr><p>身份验证完成以后,需要给苹果的技术顾问打电话,说明已完成身份验证,要申请企业级开发者账号。等待技术顾问处理完,我们就可以到网页去继续申请企业级开发者账号了。</p><p>苹果技术顾问联系方式:<a href="https://developer.apple.com/contact/topic/select">https://developer.apple.com/contact/topic/select</a></p><p>具体流程步骤:会员资格和账户->计划注册->电话->立即与开发者支持顾问通话。如图:</p><img src="https://img.wenhairu.com/images/2021/09/06/GRc3G.png" alt="image-20210903163637852" style="zoom:20%;" /><img src="https://img.wenhairu.com/images/2021/09/06/GRMfv.png" alt="image-20210903163921762" style="zoom:20%;" /><img src="https://img.wenhairu.com/images/2021/09/06/GRPQ0.png" alt="image-20210903170748608" style="zoom:20%;" /><img src="https://img.wenhairu.com/images/2021/09/06/GRZBU.png" alt="image-20210903170834031" style="zoom:20%;" /><p>苹果的技术顾问会回拨我们输入的电话。</p><p>小提示:无论遇到任何问题,联系技术顾问都是首要的解决方案。</p><h2 id="五、填写企业-政府机构资料"><a href="#五、填写企业-政府机构资料" class="headerlink" title="五、填写企业/政府机构资料"></a>五、填写企业/政府机构资料</h2><hr><p>经过了打电话给苹果技术顾问说明要申请企业开发者账号之后,需要我们进一步填写企业的信息。</p><p>填写资料需要在网页进行,网页地址:<a href="https://developer.apple.com/cn/programs/enterprise/">https://developer.apple.com/cn/programs/enterprise/</a></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GR4Aj.png" alt="image-20210903171619933"></p><p>选择分发方式为:<strong>仅在我的组织内部使用的专属app</strong></p><p>点击开始填写申请表格,就来到了如下的界面:</p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRI1g.png" alt="image-20210903172257166"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GROIK.md.png" alt="image-20210903172530060"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRTh3.png" alt="image-20210903172900423"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRXEo.png" alt="image-20210903172731412"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRegf.png" alt="image-20210903173016536"></p><p>点击继续,确认信息。</p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRB3d.png" alt="image-20210903173148528"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRdwH.png" alt="image-20210903173227756"></p><p><img src="https://img.wenhairu.com/images/2021/09/06/GRiRq.png" alt="image-20210903173257257"></p><p>至此,资料提交就走完了。接下来需要等待苹果公司对资质的审核。</p><h2 id="六、收到苹果审核反馈邮件"><a href="#六、收到苹果审核反馈邮件" class="headerlink" title="六、收到苹果审核反馈邮件"></a>六、收到苹果审核反馈邮件</h2><hr><p><img src="https://img.wenhairu.com/images/2021/09/07/GcRWu.png" alt="WX20210907-194325@2x"></p><p>回复的大概内容如下:</p><p><img src="https://img.wenhairu.com/images/2021/09/07/Gck7h.png"></p>]]></content>
<summary type="html"><h2 id="一、准备资料"><a href="#一、准备资料" class="headerlink" title="一、准备资料"></a>一、准备资料</h2><hr>
<p>1、企业/政府机构信息</p>
<table>
<thead>
<tr>
<th><strong></summary>
<category term="企业级开发者" scheme="http://example.com/tags/%E4%BC%81%E4%B8%9A%E7%BA%A7%E5%BC%80%E5%8F%91%E8%80%85/"/>
</entry>
<entry>
<title>mac上如何使用wine运行windows程序</title>
<link href="http://example.com/2021/07/28/mac%E4%B8%8A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8wine%E8%BF%90%E8%A1%8Cwindows%E7%A8%8B%E5%BA%8F/"/>
<id>http://example.com/2021/07/28/mac%E4%B8%8A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8wine%E8%BF%90%E8%A1%8Cwindows%E7%A8%8B%E5%BA%8F/</id>
<published>2021-07-28T02:47:02.000Z</published>
<updated>2021-07-28T02:56:35.336Z</updated>
<content type="html"><![CDATA[<h3 id="Wine官网"><a href="#Wine官网" class="headerlink" title="Wine官网"></a><a href="https://www.winehq.org/">Wine官网</a></h3><h3 id="什么是Win"><a href="#什么是Win" class="headerlink" title="什么是Win?"></a>什么是Win?</h3><p>Wine (“Wine Is Not an Emulator” 的首字母缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Linux,macOS 及 BSD 等)上运行 Windows 应用的兼容层。Wine 不是像虚拟机或者模拟器一样模仿内部的 Windows 逻辑,而是將 Windows API 调用翻译成为动态的 POSIX 调用,免除了性能和其他一些行为的内存占用,让你能够干净地集合 Windows 应用到你的桌面。</p><h3 id="如何安装"><a href="#如何安装" class="headerlink" title="如何安装"></a>如何安装</h3><ul><li>下载</li></ul>]]></content>
<summary type="html"><h3 id="Wine官网"><a href="#Wine官网" class="headerlink" title="Wine官网"></a><a href="https://www.winehq.org/">Wine官网</a></h3><h3 id="什么是Win"><a </summary>
<category term="wine & Mac" scheme="http://example.com/tags/wine-Mac/"/>
</entry>
<entry>
<title>两个网站教你如何免费翻墙</title>
<link href="http://example.com/2021/07/12/%E4%B8%A4%E4%B8%AA%E7%BD%91%E7%AB%99%E6%95%99%E4%BD%A0%E5%A6%82%E4%BD%95%E5%85%8D%E8%B4%B9%E7%BF%BB%E5%A2%99/"/>
<id>http://example.com/2021/07/12/%E4%B8%A4%E4%B8%AA%E7%BD%91%E7%AB%99%E6%95%99%E4%BD%A0%E5%A6%82%E4%BD%95%E5%85%8D%E8%B4%B9%E7%BF%BB%E5%A2%99/</id>
<published>2021-07-12T14:38:30.000Z</published>
<updated>2021-07-12T15:02:55.679Z</updated>
<content type="html"><![CDATA[<p>网站1:<a href="https://community.torproject.org/">Tor</a></p><p>网站2:<a href="http://free-proxy.cz/">免费代理服务器</a></p><ul><li><h3 id="原理"><a href="#原理" class="headerlink" title="原理"></a>原理</h3></li></ul><p> 翻墙一般我们使用代理服务器,这里我们使用免费代理服务器来完成,如果平时浏览网页看视频基本够用了。</p><ul><li><h3 id="为什么用Tor"><a href="#为什么用Tor" class="headerlink" title="为什么用Tor"></a>为什么用Tor</h3></li></ul><p> Tor是一款很安全和私密的浏览器,如果你用过chrome你会发现,代理都需要到系统设置里去设置,如果你只想在浏览器做代理,chrome是办不到的。不过Tor有一不好的地方是访问会比较慢,但是为了翻墙你可以接受的。</p><ul><li><h3 id="Tor的代理配置"><a href="#Tor的代理配置" class="headerlink" title="Tor的代理配置"></a>Tor的代理配置</h3></li></ul><p> 假设你已经安装好了Tor,并且免费代理服务器的IP和端口号你也拿到了。这里我们用SOCKS5作为例子。配置Tor只需要勾选代理并填好服务器和端口号就可以。如图。</p><p><img src="https://img.wenhairu.com/images/2021/07/12/9sbON.png"></p><ul><li><h3 id="一些免费代理服务器列表"><a href="#一些免费代理服务器列表" class="headerlink" title="一些免费代理服务器列表"></a>一些免费代理服务器列表</h3></li></ul><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">51.222.12.245:10084</span><br><span class="line">51.222.121.242:9300</span><br><span class="line">51.222.123.217:9300</span><br><span class="line">51.222.123.216:9300</span><br><span class="line">51.222.121.239:9300</span><br><span class="line">51.222.123.210:9300</span><br><span class="line">51.222.121.245:9300</span><br><span class="line">51.222.123.191:9300</span><br><span class="line">167.172.141.70:43959</span><br><span class="line">51.222.123.214:9300</span><br><span class="line">51.222.123.212:9300</span><br><span class="line">54.205.23.148:1080</span><br><span class="line">47.253.43.183:8888</span><br><span class="line">51.222.123.203:9300</span><br><span class="line">191.96.42.80:1080</span><br><span class="line">147.135.112.67:3081</span><br><span class="line">18.116.54.118:1080</span><br><span class="line">74.123.21.22:56576</span><br><span class="line">51.222.123.194:9300</span><br><span class="line">38.91.106.204:30829</span><br><span class="line">154.91.32.78:1080</span><br><span class="line">34.211.41.50:1080</span><br><span class="line">104.255.170.196:9300</span><br><span class="line">67.213.212.16:48428</span><br><span class="line">72.210.252.137:4145</span><br><span class="line">72.223.168.67:4145</span><br><span class="line">198.199.86.11:1080</span><br><span class="line">72.217.216.239:4145</span><br><span class="line">72.206.181.123:4145</span><br><span class="line">70.166.167.36:4145</span><br><span class="line">184.179.216.130:4145</span><br><span class="line">98.185.83.111:4145</span><br><span class="line">98.185.83.105:12752</span><br><span class="line">72.221.196.145:4145</span><br><span class="line">98.162.25.23:4145</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><p>网站1:<a href="https://community.torproject.org/">Tor</a></p>
<p>网站2:<a href="http://free-proxy.cz/">免费代理服务器</a></p>
<ul>
<li><h3 id="原理"><</summary>
<category term="翻墙" scheme="http://example.com/tags/%E7%BF%BB%E5%A2%99/"/>
</entry>
<entry>
<title>WKWebView与js交互的注意事项</title>
<link href="http://example.com/2021/07/09/WKWebView%E4%B8%8Ejs%E4%BA%A4%E4%BA%92%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/"/>
<id>http://example.com/2021/07/09/WKWebView%E4%B8%8Ejs%E4%BA%A4%E4%BA%92%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/</id>
<published>2021-07-09T02:27:22.000Z</published>
<updated>2021-07-09T03:04:31.420Z</updated>
<content type="html"><![CDATA[<ul><li><h5 id="WKWebView简单使用"><a href="#WKWebView简单使用" class="headerlink" title="WKWebView简单使用"></a>WKWebView简单使用</h5><p><a href="https://www.jianshu.com/p/5cf0d241ae12">例子</a></p></li></ul><ul><li><h5 id="JS调用原生"><a href="#JS调用原生" class="headerlink" title="JS调用原生"></a>JS调用原生</h5></li></ul><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">window.webkit.messageHandlers.<name>.postMessage(<messageBody>)</span><br><span class="line">//其中<name>,就是上面方法里的第二个参数`name`。</span><br><span class="line">//例如我们调用API的时候第二个参数填@"Share",那么在JS里就是:</span><br><span class="line">//window.webkit.messageHandlers.Share.postMessage(<messageBody>)</span><br><span class="line">//<messageBody>是一个键值对,键是body,值可以有多种类型的参数。</span><br><span class="line">// 在`WKScriptMessageHandler`协议中,我们可以看到mssage是`WKScriptMessage`类型,有一个属性叫body。</span><br><span class="line">// 而注释里写明了body 的类型:</span><br><span class="line">Allowed types are NSNumber, NSString, NSDate, NSArray, NSDictionary, and NSNull.</span><br></pre></td></tr></table></figure><p>!!!注意:<messageBody>不可以不传参,否则不会调用。</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 传null</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">scanClick</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="built_in">window</span>.webkit.messageHandlers.ScanAction.postMessage(<span class="literal">null</span>);</span><br><span class="line">}</span><br><span class="line"><span class="comment">// 传字典 </span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">shareClick</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="built_in">window</span>.webkit.messageHandlers.Share.postMessage({<span class="attr">title</span>:<span class="string">'测试分享的标题'</span>,<span class="attr">content</span>:<span class="string">'测试分享的内容'</span>,<span class="attr">url</span>:<span class="string">'http://www.baidu.com'</span>});</span><br><span class="line">}</span><br><span class="line"><span class="comment">// 传字符串</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">playSound</span>(<span class="params"></span>) </span>{ </span><br><span class="line"> <span class="built_in">window</span>.webkit.messageHandlers.PlaySound.postMessage(<span class="string">'shake_sound_male.wav'</span>);</span><br><span class="line">}</span><br><span class="line"><span class="comment">// 传数组</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">colorClick</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="built_in">window</span>.webkit.messageHandlers.Color.postMessage([<span class="number">67</span>,<span class="number">205</span>,<span class="number">128</span>,<span class="number">0.5</span>]);</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p><a href="https://blog.csdn.net/u011619283/article/details/52135988">参考</a></p><ul><li><h4 id="原生调用JS"><a href="#原生调用JS" class="headerlink" title="原生调用JS"></a>原生调用JS</h4></li></ul><p>JS</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">div</span> <span class="attr">id</span>=<span class="string">"demo"</span>></span><span class="tag"></<span class="name">div</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">script</span>></span></span><br><span class="line"><span class="javascript"> <span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params">name</span>)</span>{</span></span><br><span class="line"><span class="javascript"> <span class="built_in">console</span>.log(name);</span></span><br><span class="line"><span class="javascript"> <span class="built_in">document</span>.getElementById(<span class="string">"demo"</span>).innerHTML = name;</span></span><br><span class="line"> }</span><br><span class="line"> <span class="tag"></<span class="name">script</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p> Objective-C</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">NSString *jsStr = [NSString stringWithFormat:@"test('%@')",@"what the hell"];[self.webView evaluateJavaScript:jsStr completionHandler:^(id _Nullable result, NSError * _Nullable error) {</span><br><span class="line"> NSLog(@"%@--%@",result,error);</span><br><span class="line">}];</span><br></pre></td></tr></table></figure><ul><li><h5 id="原生调用VUE"><a href="#原生调用VUE" class="headerlink" title="原生调用VUE"></a>原生调用VUE</h5><p>VUE</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">export default{</span><br><span class="line"> ...</span><br><span class="line"> created(){</span><br><span class="line"> window.nativeCallJS = this.nativeCallJS</span><br><span class="line"> },</span><br><span class="line"> methods:{</span><br><span class="line"> nativeCallJS:function(data){</span><br><span class="line"> return "return data" + data</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> ...</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p>Objective-C</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">window.webkit.messageHandlers.jsCallNative.postMessage(params)</span><br></pre></td></tr></table></figure><p><a href="https://blog.csdn.net/Yao_MG/article/details/107237764">参考1</a> <a href="https://blog.csdn.net/lyyo_cd/article/details/84304864">参考2</a></p></li><li><h5 id="OC向JS传值"><a href="#OC向JS传值" class="headerlink" title="OC向JS传值"></a>OC向JS传值</h5><p>如果是单个值,可以如下:</p><p>如果是多个值,可以传json string。</p><p><a href="https://blog.csdn.net/zjpjay/article/details/103694844">参考</a></p></li></ul>]]></content>
<summary type="html"><ul>
<li><h5 id="WKWebView简单使用"><a href="#WKWebView简单使用" class="headerlink" title="WKWebView简单使用"></a>WKWebView简单使用</h5><p><a href="https://</summary>
<category term="WKWebView&JS" scheme="http://example.com/tags/WKWebView-JS/"/>
</entry>
<entry>
<title>一张图搞定ios framework重签</title>
<link href="http://example.com/2021/06/08/%E4%B8%80%E5%BC%A0%E5%9B%BE%E6%90%9E%E5%AE%9Aios-framework%E9%87%8D%E7%AD%BE/"/>
<id>http://example.com/2021/06/08/%E4%B8%80%E5%BC%A0%E5%9B%BE%E6%90%9E%E5%AE%9Aios-framework%E9%87%8D%E7%AD%BE/</id>
<published>2021-06-08T05:33:29.000Z</published>
<updated>2021-06-08T05:41:17.191Z</updated>
<content type="html"><![CDATA[<p>重签常用命令</p><h5 id="1-查看framework的签名证书命令:"><a href="#1-查看framework的签名证书命令:" class="headerlink" title="1.查看framework的签名证书命令:"></a>1.查看framework的签名证书命令:</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">codesign -d -vv xxxxx.framework</span><br></pre></td></tr></table></figure><h5 id="2-删除原有的签名"><a href="#2-删除原有的签名" class="headerlink" title="2.删除原有的签名"></a>2.删除原有的签名</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">进入到XX.framwork文件夹内,删除_CodeSignature文件夹</span><br></pre></td></tr></table></figure><h5 id="3-查看本机可用的签名文件-命令:"><a href="#3-查看本机可用的签名文件-命令:" class="headerlink" title="3.查看本机可用的签名文件,命令:"></a>3.查看本机可用的签名文件,命令:</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/usr/bin/security find-identity -v -p codesigning</span><br></pre></td></tr></table></figure><h5 id="4-使用签名文件签名命令:"><a href="#4-使用签名文件签名命令:" class="headerlink" title="4.使用签名文件签名命令:"></a>4.使用签名文件签名命令:</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">codesign -fs "iPhone Developer: ... (...)" xxxxx.framework</span><br></pre></td></tr></table></figure><p>完成</p><p><img src="https://s1.imagehub.cc/images/2021/06/08/iOS-framework25ceb1c3b98396b8.png" alt="iOS framework动态库重签名"></p>]]></content>
<summary type="html"><p>重签常用命令</p>
<h5 id="1-查看framework的签名证书命令:"><a href="#1-查看framework的签名证书命令:" class="headerlink" title="1.查看framework的签名证书命令:"></a>1.查看frame</summary>
<category term="重签" scheme="http://example.com/tags/%E9%87%8D%E7%AD%BE/"/>
</entry>
<entry>
<title>Unable to interpret the specified path</title>
<link href="http://example.com/2021/01/27/Unable-to-interpret-the-specified-path/"/>
<id>http://example.com/2021/01/27/Unable-to-interpret-the-specified-path/</id>
<published>2021-01-27T03:00:19.000Z</published>
<updated>2021-01-27T03:01:28.117Z</updated>
<content type="html"><![CDATA[<h1 id="Unable-to-interpret-the-specified-path"><a href="#Unable-to-interpret-the-specified-path" class="headerlink" title="Unable to interpret the specified path"></a>Unable to interpret the specified path</h1><p>解决:pod spec lint –verbose</p>]]></content>
<summary type="html"><h1 id="Unable-to-interpret-the-specified-path"><a href="#Unable-to-interpret-the-specified-path" class="headerlink" title="Unable to interp</summary>
<category term="pods" scheme="http://example.com/tags/pods/"/>
</entry>
<entry>
<title>Swift 学习笔记三</title>
<link href="http://example.com/2021/01/14/Swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%89/"/>
<id>http://example.com/2021/01/14/Swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%89/</id>
<published>2021-01-14T14:46:52.000Z</published>
<updated>2021-01-15T01:20:06.809Z</updated>
<content type="html"><![CDATA[<h2 id="函数"><a href="#函数" class="headerlink" title="函数"></a>函数</h2><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">funcname</span><span class="params">(形参)</span></span> -> returnType {</span><br><span class="line">statement</span><br><span class="line"><span class="keyword">return</span> parameters</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">funcname</span><span class="params">()</span></span> -> datatype {</span><br><span class="line"> <span class="keyword">return</span> datatype</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li><p>元祖</p><p>**元组(tuples)**把多个值组合成一个复合值。本质上是一组数据。</p></li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> http404Error = (<span class="number">404</span>, <span class="string">"Not Found"</span>)</span><br><span class="line"><span class="comment">// http404Error 的类型是 (Int, String),值是 (404, "Not Found")</span></span><br><span class="line"><span class="comment">// 这个元组可以被描述为“一个类型为 (Int, String) *的元组”</span></span><br></pre></td></tr></table></figure><ul><li>元祖作为返回值</li></ul><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">func funcname(形参) -> (元祖) {</span><br><span class="line">statement</span><br><span class="line">return </span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li><p>可变参数</p><blockquote><p>可变参数可以接受零个或多个值。函数调用时,你可以用可变参数来指定函数参数,其数量是不确定的。可变参数通过在变量类型名后面加入(…)的方式来定义。</p></blockquote></li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">vari</span><N><span class="params">(members: N...)</span></span>{</span><br><span class="line"> <span class="keyword">for</span> i <span class="keyword">in</span> members {</span><br><span class="line"> <span class="built_in">print</span>(i)</span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li><p>变量参数</p><p>一般默认在函数中定义的参数都是常量参数,也就是这个参数你只可以查询使用,不能改变它的值。</p><p>如果想要声明一个变量参数,可以在<code>参数定义前</code>加 <code>inout</code>关键字,这样就可以改变这个参数的值了。</p></li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">getName</span><span class="params">(<span class="keyword">_</span> name: <span class="keyword">inout</span> String)</span></span>.........</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">swapTwoInts</span><span class="params">(<span class="keyword">_</span> a: <span class="keyword">inout</span> Int, <span class="keyword">_</span> b: <span class="keyword">inout</span> Int)</span></span> {</span><br><span class="line"> <span class="keyword">let</span> temporaryA = a</span><br><span class="line"> a = b</span><br><span class="line"> b = temporaryA</span><br><span class="line">}</span><br><span class="line"><span class="keyword">var</span> x = <span class="number">1</span></span><br><span class="line"><span class="keyword">var</span> y = <span class="number">5</span></span><br><span class="line">swapTwoInts(&x, &y)</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h2 id="函数"><a href="#函数" class="headerlink" title="函数"></a>函数</h2><figure class="highlight swift"><table><tr><td class="gutter"><pre><span </summary>
<category term="swift 学习笔记" scheme="http://example.com/tags/swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title>Swift 学习笔记二</title>
<link href="http://example.com/2021/01/14/Swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%BA%8C/"/>
<id>http://example.com/2021/01/14/Swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%BA%8C/</id>
<published>2021-01-14T01:55:03.000Z</published>
<updated>2021-01-14T03:10:37.561Z</updated>
<content type="html"><![CDATA[<h2 id="数组"><a href="#数组" class="headerlink" title="数组"></a>数组</h2><ul><li>空数组</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> someArray = [<span class="type">SomeType</span>]() <span class="comment">//空数组</span></span><br><span class="line">*<span class="keyword">var</span> names = [<span class="type">String</span>]()</span><br></pre></td></tr></table></figure><ul><li>初始化大小</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> someArray = [<span class="type">SomeType</span>](repeating: <span class="type">InitialValue</span>, <span class="built_in">count</span>: <span class="type">NumbeOfElements</span>)</span><br><span class="line"><span class="keyword">var</span> someInts = [<span class="type">Int</span>](repeating: <span class="number">0</span>,<span class="built_in">count</span>: <span class="number">10</span>)</span><br><span class="line"><span class="keyword">var</span> someString = [<span class="type">String</span>](repeating: <span class="string">"ban"</span>,<span class="built_in">count</span>: <span class="number">10</span>)</span><br></pre></td></tr></table></figure><ul><li><p>访问数组</p><p>索引。比如:someInts[0]</p></li><li><p>修改数组</p></li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//append 或者 +=</span></span><br><span class="line">someInts.append(<span class="number">20</span>)</span><br><span class="line">someInts.append(<span class="number">30</span>)</span><br><span class="line">someInts += [<span class="number">40</span>]</span><br><span class="line"></span><br><span class="line"><span class="comment">//索引修改</span></span><br><span class="line">someInts[<span class="number">2</span>] = <span class="number">50</span></span><br></pre></td></tr></table></figure><ul><li>遍历数组</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//普通</span></span><br><span class="line"><span class="keyword">for</span> item <span class="keyword">in</span> someStrs {</span><br><span class="line"> <span class="built_in">print</span>(item)</span><br><span class="line">}</span><br><span class="line"><span class="comment">//同时需要每个数据项的值和索引值,可以使用 String 的 enumerate() 方法来进行数组遍历</span></span><br><span class="line"><span class="keyword">for</span> (index, item) <span class="keyword">in</span> someStrs.enumerated() {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"在 index = \(index) 位置上的值为 \(item)"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>合并数组</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//使用加法操作符(+)来合并两种已存在的相同类型数组</span></span><br><span class="line"><span class="keyword">var</span> intsC = intsA + intsB</span><br></pre></td></tr></table></figure><ul><li>count属性</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> intsA = [<span class="type">Int</span>](<span class="built_in">count</span>:<span class="number">2</span>, repeatedValue: <span class="number">2</span>)</span><br><span class="line"><span class="built_in">println</span>(<span class="string">"\(intsA.count)"</span>)</span><br></pre></td></tr></table></figure><ul><li><p>isEmpty属性</p><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">SomeInts</span>.isEmpty</span><br></pre></td></tr></table></figure></li></ul><h2 id="字典"><a href="#字典" class="headerlink" title="字典"></a>字典</h2><ul><li>空字典</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> someDict = [<span class="type">KeyType</span>: <span class="type">ValueType</span>]()</span><br><span class="line"><span class="keyword">var</span> someDict = [<span class="type">String</span>: <span class="type">String</span>]()</span><br><span class="line"><span class="keyword">var</span> someDict:[<span class="type">String</span>: <span class="type">String</span>] = [<span class="string">"name"</span>: <span class="string">"ban"</span>,<span class="string">"sex"</span>: <span class="string">"m"</span>]</span><br></pre></td></tr></table></figure><ul><li>修改字典</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//使用 updateValue(forKey:) 增加或更新字典的内容。如果 key 不存在,则添加值,如果存在则修改 key 对应的值</span></span><br><span class="line"><span class="keyword">var</span> oldVal = someDict.updateValue(<span class="string">"bandianhong"</span>, forKey: <span class="string">"name"</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">//使用索引修改</span></span><br><span class="line">someDict[<span class="number">0</span>] = <span class="string">"ban"</span></span><br></pre></td></tr></table></figure><ul><li>移除元素</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//使用 removeValueForKey() 方法来移除字典 key-value 对,如果 key 存在该方法返回移除的值,如果不存在返回 nil 。</span></span><br><span class="line"><span class="keyword">var</span> removedValue = someDict.removeValue(forKey: <span class="string">"name"</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">//指定键值对移除</span></span><br><span class="line">someDict[<span class="string">"name"</span>] = <span class="literal">nil</span></span><br></pre></td></tr></table></figure><ul><li>遍历字典</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> (key, value) <span class="keyword">in</span> someDict {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"字典 key \(key) - 字典 value \(value)"</span>)</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (key, value) <span class="keyword">in</span> someDict.enumerated() {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"字典 key \(key) - 字典 (key, value) 对 \(value)"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>字典转换为数组</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> dictKeys = [<span class="type">String</span>](someDict.keys)</span><br><span class="line"><span class="keyword">let</span> dictValues = [<span class="type">String</span>](someDict.values)</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h2 id="数组"><a href="#数组" class="headerlink" title="数组"></a>数组</h2><ul>
<li>空数组</li>
</ul>
<figure class="highlight swift"><table><tr><td cl</summary>
</entry>
<entry>
<title>swift 学习笔记一</title>
<link href="http://example.com/2021/01/13/swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%80/"/>
<id>http://example.com/2021/01/13/swift-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%80/</id>
<published>2021-01-13T14:26:57.000Z</published>
<updated>2021-01-14T16:25:57.374Z</updated>
<content type="html"><![CDATA[<h3 id="类型别名"><a href="#类型别名" class="headerlink" title="类型别名"></a>类型别名</h3><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typealias</span> newname = type</span><br><span class="line"></span><br><span class="line">typealis <span class="type">Feet</span> = <span class="type">Int</span></span><br><span class="line"><span class="keyword">var</span> feet: <span class="type">Feet</span> = <span class="number">1</span></span><br></pre></td></tr></table></figure><h3 id="变量"><a href="#变量" class="headerlink" title="变量"></a>变量</h3><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> variableName = <initial value></span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> name = <span class="string">"ban"</span></span><br></pre></td></tr></table></figure><ul><li>输出</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">println</span>(<span class="string">"\(name)"</span>)</span><br></pre></td></tr></table></figure><h3 id="可选-Optionals-类型"><a href="#可选-Optionals-类型" class="headerlink" title="可选(Optionals)类型"></a>可选(Optionals)类型</h3><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">Swift</span> 的可选(<span class="type">Optional</span>)类型,用于处理值缺失的情况。可选表示<span class="string">"那儿有一个值,并且它等于 x "</span>或者<span class="string">"那儿没有值"</span>。</span><br><span class="line"><span class="type">Swfit</span>语言定义后缀?作为命名类型<span class="type">Optional</span>的简写,换句话说,以下两种声明是相等的:</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> optionalInteger: <span class="type">Int?</span></span><br><span class="line"><span class="keyword">var</span> optionalInteger: <span class="type">Optional</span><<span class="type">Int</span>></span><br><span class="line">在这两种情况下,变量 optionalInteger 都是可选整数类型。注意,在类型和 ?之间没有空格。</span><br><span class="line"></span><br><span class="line"><span class="type">Optional</span> 是一个含有两种情况的枚举,<span class="type">None</span> 和 <span class="type">Some</span>(<span class="type">T</span>),用来表示可能有或可能没有值。任何类型都可以明确声明为(或者隐式转换)可选类型。当声明一个可选类型的时候,要确保用括号给 ? 操作符一个合适的范围。例如,声明可选整数数组,应该写成 (<span class="type">Int</span>[])? 写成 <span class="type">Int</span>[]? 会报错。</span><br><span class="line"></span><br><span class="line">当你声明一个可选变量或者可选属性的时候没有提供初始值,它的值会默认为 <span class="literal">nil</span>。</span><br><span class="line"></span><br><span class="line">可选项遵照 <span class="type">LogicValue</span> 协议,因此可以出现在布尔环境中。在这种情况下,如果可选类型<span class="type">T?</span>包含类型为<span class="type">T</span>的任何值(也就是说它的值是 <span class="type">Optional</span>.<span class="type">Some</span>(<span class="type">T</span>) ),这个可选类型等于 <span class="literal">true</span>,反之为 <span class="literal">false</span>。</span><br><span class="line"></span><br><span class="line">如果一个可选类型的实例包含一个值,你可以用后缀操作符 !来访问这个值,如下所示:</span><br><span class="line"></span><br><span class="line">optionalInteger = <span class="number">42</span></span><br><span class="line">optionalInteger! <span class="comment">// 42</span></span><br><span class="line">使用操作符!去获取值为<span class="literal">nil</span>的可选变量会有运行时错误。</span><br><span class="line"></span><br><span class="line">你可以用可选链接和可选绑定选择性执行可选表达式上的操作。如果值为<span class="literal">nil</span>,任何操作都不会执行,也不会有运行报错。</span><br><span class="line"></span><br><span class="line">让我们来详细看下以下实例来了解 <span class="type">Swift</span> 中可选类型的应用:</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Cocoa</span><br><span class="line"><span class="keyword">var</span> myString:<span class="type">String?</span> = <span class="literal">nil</span></span><br><span class="line"><span class="keyword">if</span> myString != <span class="literal">nil</span> {</span><br><span class="line"> <span class="built_in">print</span>(myString)</span><br><span class="line">}<span class="keyword">else</span>{</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"字符串为 nil"</span>)</span><br><span class="line">}</span><br><span class="line">以上程序执行结果为:</span><br><span class="line">字符串为 <span class="literal">nil</span></span><br><span class="line"></span><br><span class="line">可选类型类似于<span class="type">Objective</span>-<span class="type">C</span>中指针的<span class="literal">nil</span>值,但是<span class="literal">nil</span>只对类(<span class="class"><span class="keyword">class</span>)有用,而可选类型对所有的类型都可用,并且更安全。</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class">强制解析</span></span><br><span class="line"><span class="class">当你确定可选类型确实包含值之后,你可以在可选的名字后面加一个感叹号(!)来获取值。这个感叹号表示"我知道这个可选有值,请使用它。"这被称为可选值的强制解析(<span class="title">forced</span> <span class="title">unwrapping</span>)。</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class">实例如下:</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class"><span class="title">import</span> <span class="title">Cocoa</span></span></span><br><span class="line"><span class="class"><span class="title">var</span> <span class="title">myString</span>:<span class="title">String</span>?</span></span><br><span class="line"><span class="class"><span class="title">myString</span> = "<span class="title">Hello</span>, <span class="title">Swift</span>!"</span></span><br><span class="line"><span class="class"><span class="title">if</span> <span class="title">myString</span> != <span class="title">nil</span> </span>{</span><br><span class="line"> <span class="built_in">print</span>(myString)</span><br><span class="line">}<span class="keyword">else</span>{</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"myString 值为 nil"</span>)</span><br><span class="line">}</span><br><span class="line">以上程序执行结果为:</span><br><span class="line"></span><br><span class="line"><span class="type">Optional</span>(<span class="string">"Hello, Swift!"</span>)</span><br><span class="line">强制解析可选值,使用感叹号(!):</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Cocoa</span><br><span class="line"><span class="keyword">var</span> myString:<span class="type">String?</span></span><br><span class="line">myString = <span class="string">"Hello, Swift!"</span></span><br><span class="line"><span class="keyword">if</span> myString != <span class="literal">nil</span> {</span><br><span class="line"> <span class="comment">// 强制解析</span></span><br><span class="line"> <span class="built_in">print</span>( myString! )</span><br><span class="line">}<span class="keyword">else</span>{</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"myString 值为 nil"</span>)</span><br><span class="line">}</span><br><span class="line">以上程序执行结果为:</span><br><span class="line"></span><br><span class="line"><span class="type">Hello</span>, <span class="type">Swift!</span></span><br><span class="line"></span><br><span class="line">注意:</span><br><span class="line">使用!来获取一个不存在的可选值会导致运行时错误。使用!来强制解析值之前,一定要确定可选包含一个非<span class="literal">nil</span>的值。</span><br><span class="line"></span><br><span class="line">自动解析</span><br><span class="line">你可以在声明可选变量时使用感叹号(!)替换问号(?)。这样可选变量在使用时就不需要再加一个感叹号(!)来获取值,它会自动解析。</span><br><span class="line"></span><br><span class="line">实例如下:</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Cocoa</span><br><span class="line"><span class="keyword">var</span> myString:<span class="type">String!</span></span><br><span class="line">myString = <span class="string">"Hello, Swift!"</span></span><br><span class="line"><span class="keyword">if</span> myString != <span class="literal">nil</span> {</span><br><span class="line"> <span class="built_in">print</span>(myString)</span><br><span class="line">}<span class="keyword">else</span>{</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"myString 值为 nil"</span>)</span><br><span class="line">}</span><br><span class="line">以上程序执行结果为:</span><br><span class="line"></span><br><span class="line"><span class="type">Hello</span>, <span class="type">Swift!</span></span><br><span class="line">可选绑定</span><br><span class="line">使用可选绑定(<span class="keyword">optional</span> binding)来判断可选类型是否包含值,如果包含就把值赋给一个临时常量或者变量。可选绑定可以用在<span class="keyword">if</span>和<span class="keyword">while</span>语句中来对可选类型的值进行判断并把值赋给一个常量或者变量。</span><br><span class="line"></span><br><span class="line">像下面这样在<span class="keyword">if</span>语句中写一个可选绑定:</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">let</span> constantName = someOptional {</span><br><span class="line"> statements</span><br><span class="line">}</span><br><span class="line">让我们来看下一个简单的可选绑定实例:</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Cocoa</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> myString:<span class="type">String?</span></span><br><span class="line"></span><br><span class="line">myString = <span class="string">"Hello, Swift!"</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">let</span> yourString = myString {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"你的字符串值为 - \(yourString)"</span>)</span><br><span class="line">}<span class="keyword">else</span>{</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"你的字符串没有值"</span>)</span><br><span class="line">}</span><br><span class="line">以上程序执行结果为:</span><br><span class="line"></span><br><span class="line">你的字符串值为 - <span class="type">Hello</span>, <span class="type">Swift!</span></span><br></pre></td></tr></table></figure><h3 id="常量"><a href="#常量" class="headerlink" title="常量"></a>常量</h3><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> constantName = <initial value></span><br><span class="line"><span class="keyword">let</span> name = <span class="string">"ban"</span></span><br></pre></td></tr></table></figure><ul><li>类型标注</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> constantName:<data type> = <<span class="keyword">optional</span> initial value></span><br><span class="line"><span class="keyword">var</span> name: <span class="type">String</span> = <span class="string">"ban"</span></span><br></pre></td></tr></table></figure><ul><li>Unicode 支持</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> 名字 = <span class="string">"ban"</span></span><br></pre></td></tr></table></figure><h3 id="条件语句"><a href="#条件语句" class="headerlink" title="条件语句"></a>条件语句</h3><ul><li>if</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> boolean_expression {</span><br><span class="line"> <span class="comment">/* 如果布尔表达式为真将执行的语句 */</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> varA:<span class="type">Int</span> = <span class="number">10</span>;</span><br><span class="line"><span class="keyword">if</span> varA < <span class="number">20</span> {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"varA 小于 20"</span>);</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>if else</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> boolean_expression_1 {</span><br><span class="line"> <span class="comment">/* 如果 boolean_expression_1 表达式为 true 则执行该语句 */</span></span><br><span class="line">} <span class="keyword">else</span> <span class="keyword">if</span> boolean_expression_2 {</span><br><span class="line"> <span class="comment">/* 如果 boolean_expression_2 表达式为 true 则执行该语句 */</span></span><br><span class="line">} <span class="keyword">else</span> <span class="keyword">if</span> boolean_expression_3 {</span><br><span class="line"> <span class="comment">/* 如果 boolean_expression_3 表达式为 true 则执行该语句 */</span></span><br><span class="line">} <span class="keyword">else</span> {</span><br><span class="line"> <span class="comment">/* 如果以上所有条件表达式都不为 true 则执行该语句 */</span></span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>嵌套If</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> boolean_expression_1 {</span><br><span class="line"> <span class="comment">/* 当 boolean_expression_1 表达式 true 时执行 */</span></span><br><span class="line"> <span class="keyword">if</span> boolean_expression_2 {</span><br><span class="line"> <span class="comment">/* 当 boolean_expression_1 表达式 true 时执行 */</span></span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>switch</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">switch</span> expression {</span><br><span class="line"> <span class="keyword">case</span> expression1 :</span><br><span class="line"> statement(s)</span><br><span class="line"> <span class="keyword">fallthrough</span> <span class="comment">/* 可选 */</span></span><br><span class="line"> <span class="keyword">case</span> expression2, expression3 :</span><br><span class="line"> statement(s)</span><br><span class="line"> <span class="keyword">fallthrough</span> <span class="comment">/* 可选 */</span></span><br><span class="line"> <span class="keyword">default</span> : <span class="comment">/* 可选 */</span></span><br><span class="line"> statement(s);</span><br><span class="line">}</span><br></pre></td></tr></table></figure><blockquote><p>注意:在大多数语言中,switch 语句块中,case 要紧跟 break,否则 case 之后的语句会顺序运行,而在 Swift 语言中,默认是不会执行下去的,switch 也会终止。如果你想在 Swift 中让 case 之后的语句会按顺序继续运行,则需要使用 fallthrough 语句。</p></blockquote><h3 id="循环"><a href="#循环" class="headerlink" title="循环"></a>循环</h3><ul><li>for in</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> index <span class="keyword">in</span> <span class="keyword">var</span> {</span><br><span class="line"> 循环体</span><br><span class="line">}</span><br></pre></td></tr></table></figure><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> index <span class="keyword">in</span> <span class="number">1</span>...<span class="number">5</span> {</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"\(index) 乘于 5 为:\(index * 5)"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><blockquote><p>闭区间操作符(…)</p></blockquote><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> someInts:[<span class="type">Int</span>] = [<span class="number">10</span>, <span class="number">20</span>, <span class="number">30</span>]</span><br><span class="line"><span class="keyword">for</span> index <span class="keyword">in</span> someInts {</span><br><span class="line"> <span class="built_in">print</span>( <span class="string">"index 的值为 \(index)"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><ul><li>while</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">while</span> condition</span><br><span class="line">{</span><br><span class="line"> statement(s)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><blockquote><p>数字 0, 字符串 ‘0’ 和 “”, 空的 list(), 及未定义的变量都为 <strong>false</strong> ,其他的则都为 <strong>true</strong>。</p></blockquote><ul><li>repeat…while</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">repeat</span></span><br><span class="line">{</span><br><span class="line"> statement(s);</span><br><span class="line">}<span class="keyword">while</span>( condition );</span><br></pre></td></tr></table></figure><blockquote><p>类似 do..while</p></blockquote><h3 id="字符串"><a href="#字符串" class="headerlink" title="字符串"></a>字符串</h3><ul><li>空字符串</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> name = <span class="string">""</span></span><br><span class="line"><span class="keyword">var</span> name = <span class="type">String</span>()</span><br></pre></td></tr></table></figure><ul><li>字符串拼接</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> name = <span class="string">"ban"</span></span><br><span class="line">name += <span class="string">"dianhong"</span></span><br></pre></td></tr></table></figure><blockquote><p>字符串常量不能被修改。即使用let声明的。</p></blockquote><ul><li>字符串长度</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">\(string.<span class="built_in">count</span>)</span><br></pre></td></tr></table></figure><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> name = <span class="string">"ban"</span></span><br><span class="line"><span class="built_in">println</span>(<span class="string">"\(name.count)"</span>)</span><br></pre></td></tr></table></figure><ul><li>字符串内容比较</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">stringA == stringB</span><br></pre></td></tr></table></figure><ul><li>Unicode字符串</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">stringA.utf8</span><br><span class="line">stringA.utf16</span><br></pre></td></tr></table></figure><ul><li>字符串运算</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">isEmpty 判断字符串是否为空,返回布尔值</span><br><span class="line">hasPrefix(<span class="keyword">prefix</span>: <span class="type">String</span>) 检查字符串是否拥有特定前缀</span><br><span class="line">hasSuffix(suffix: <span class="type">String</span>) 检查字符串是否拥有特定后缀。</span><br><span class="line"><span class="type">Int</span>(<span class="type">String</span>) 转换字符串数字为整型</span><br><span class="line"><span class="type">String</span>.<span class="built_in">count</span> 计算字符串的长度</span><br><span class="line">utf8 可以通过遍历 <span class="type">String</span> 的 utf8 属性来访问它的 <span class="type">UTF</span>-<span class="number">8</span> 编码</span><br><span class="line">utf16 可以通过遍历 <span class="type">String</span> 的 utf8 属性来访问它的 utf16 编码</span><br><span class="line">unicodeScalars 可以通过遍历<span class="type">String</span>值的unicodeScalars属性来访问它的 <span class="type">Unicode</span> 标量编码.</span><br><span class="line">+ 连接两个字符串,并返回一个新的字符串</span><br><span class="line">+= 连接操作符两边的字符串并将新字符串赋值给左边的操作符变量</span><br><span class="line">== 判断两个字符串是否相等</span><br><span class="line">< 比较两个字符串,对两个字符串的字母逐一比较。</span><br><span class="line">!= 比较两个字符串是否不相等。</span><br></pre></td></tr></table></figure><h3 id="字符-Character"><a href="#字符-Character" class="headerlink" title="字符(Character)"></a>字符(Character)</h3><blockquote><p>字符只有一个</p><p>字符不能为空</p></blockquote><ul><li>字符串连接字符</li></ul><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> varA:<span class="type">String</span> = <span class="string">"Hello "</span></span><br><span class="line"><span class="keyword">let</span> varB:<span class="type">Character</span> = <span class="string">"G"</span></span><br><span class="line">varA.append( varB )</span><br></pre></td></tr></table></figure><h3 id="占位符"><a href="#占位符" class="headerlink" title="占位符"></a>占位符</h3><p><code>_</code> 下划线,系统会忽略,可以用来做占位符。</p><figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> <span class="keyword">_</span> <span class="keyword">in</span> <span class="number">1</span>...<span class="number">8</span> {</span><br><span class="line"><span class="built_in">print</span>(<span class="string">"我爱你"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h3 id="类型别名"><a href="#类型别名" class="headerlink" title="类型别名"></a>类型别名</h3><figure class="highlight swift"><table><tr><td class="gutter"><pr</summary>
<category term="swift笔记" scheme="http://example.com/tags/swift%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title>ios实现轨迹采集</title>
<link href="http://example.com/2021/01/01/ios%E5%AE%9E%E7%8E%B0%E8%BD%A8%E8%BF%B9%E9%87%87%E9%9B%86/"/>
<id>http://example.com/2021/01/01/ios%E5%AE%9E%E7%8E%B0%E8%BD%A8%E8%BF%B9%E9%87%87%E9%9B%86/</id>
<published>2021-01-01T05:03:32.000Z</published>
<updated>2021-01-01T05:25:19.669Z</updated>
<content type="html"><![CDATA[<h1 id="需求"><a href="#需求" class="headerlink" title="需求"></a>需求</h1><p>用户使用APP进行轨迹采集,每隔一段时间记录一下当前位置坐标,保持后台运行。</p><h1 id="架构"><a href="#架构" class="headerlink" title="架构"></a>架构</h1><ul><li>数据库 sqlite + BGFMDB</li><li>定位使用 INTULocationManager</li></ul><h1 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h1><p>TODO:待补充</p>]]></content>
<summary type="html"><h1 id="需求"><a href="#需求" class="headerlink" title="需求"></a>需求</h1><p>用户使用APP进行轨迹采集,每隔一段时间记录一下当前位置坐标,保持后台运行。</p>
<h1 id="架构"><a href="#架构" c</summary>
<category term="轨迹采集" scheme="http://example.com/tags/%E8%BD%A8%E8%BF%B9%E9%87%87%E9%9B%86/"/>
</entry>
<entry>
<title>中国行政区划表-SQL</title>
<link href="http://example.com/2021/01/01/%E4%B8%AD%E5%9B%BD%E8%A1%8C%E6%94%BF%E5%8C%BA%E5%88%92%E8%A1%A8-SQL/"/>
<id>http://example.com/2021/01/01/%E4%B8%AD%E5%9B%BD%E8%A1%8C%E6%94%BF%E5%8C%BA%E5%88%92%E8%A1%A8-SQL/</id>
<published>2021-01-01T04:57:29.000Z</published>
<updated>2021-01-01T05:01:15.468Z</updated>
<content type="html"><![CDATA[<h1 id="项目地址"><a href="#项目地址" class="headerlink" title="项目地址"></a>项目地址</h1><p><a href="https://github.com/reference/org_division">Division</a></p><h1 id="查询方法"><a href="#查询方法" class="headerlink" title="查询方法"></a>查询方法</h1><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--SELECT * from org_division WHERE parent_id='root' ORDER BY create_time ASC;</span></span><br><span class="line"></span><br><span class="line"> <span class="comment">--查询市</span></span><br><span class="line"> <span class="comment">--SELECT * from org_division WHERE parent_id='20c49eb015cf48e9a45eee413578e62f';</span></span><br><span class="line"></span><br><span class="line"> <span class="comment">--查询区</span></span><br><span class="line"> <span class="comment">--SELECT * from org_division WHERE parent_id='13afafd6a30f4169a11a6ef8174b6581';</span></span><br></pre></td></tr></table></figure><h1 id="案例"><a href="#案例" class="headerlink" title="案例"></a>案例</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">NSString *path = [[NSBundle mainBundle] pathForResource:@"4330d398bfc148e2964492aead40b907" ofType:@"sqlite3"];</span><br><span class="line"> FMDatabase *fmdb = [FMDatabase databaseWithPath:path];</span><br><span class="line"> </span><br><span class="line"> if ([fmdb open]) {</span><br><span class="line"> fmdb.logsErrors = YES;</span><br><span class="line"> //1.query</span><br><span class="line"> NSString *query = [NSString stringWithFormat:@"SELECT * from org_division WHERE parent_id='%@' ORDER BY create_time ASC",parentId == nil ? @"root" : parentId];</span><br><span class="line"> FMResultSet *rs = [fmdb executeQuery:query];</span><br><span class="line"> // 2.遍历结果集</span><br><span class="line"> NSMutableArray *arrM = [NSMutableArray array];</span><br><span class="line"> while (rs.next) {</span><br><span class="line"> NSMutableDictionary* dictM = [[NSMutableDictionary alloc] init];</span><br><span class="line"> for (int i=0;i<[[[rs columnNameToIndexMap] allKeys] count];i++) {</span><br><span class="line"> dictM[[rs columnNameForIndex:i]] = [rs objectForColumnIndex:i];</span><br><span class="line"> }</span><br><span class="line"> GPAdministrativeDivisionsModel *m = [GPAdministrativeDivisionsModel new];</span><br><span class="line"> m.divisionCode = dictM[@"division_code"];</span><br><span class="line"> m.divisionName = dictM[@"division_name"];</span><br><span class="line"> m.divisionId = dictM[@"division_id"];</span><br><span class="line"> m.parentId = dictM[@"parent_id"];</span><br><span class="line"> m.divisionType = @"";</span><br><span class="line"> //单独处理4个直辖市</span><br><span class="line"> if ([m.divisionName isEqualToString:@"北京市"] || [m.divisionName isEqualToString:@"上海市"]</span><br><span class="line"> || [m.divisionName isEqualToString:@"天津市"] || [m.divisionName isEqualToString:@"重庆市"]) {</span><br><span class="line"> m.divisionType = @"Municipality";</span><br><span class="line"> }</span><br><span class="line"> [arrM addObject:m];</span><br><span class="line"> }</span><br><span class="line"> //查询完后要关闭rs,不然会报@"Warning: there is at least one open result set around after performing</span><br><span class="line"> [rs close];</span><br><span class="line"> [fmdb close];</span><br><span class="line"> if (completion) {</span><br><span class="line"> completion(arrM,nil);</span><br><span class="line"> }</span><br><span class="line"> }else{</span><br><span class="line"> NSLog(@"db is not open.");</span><br><span class="line"> if (completion) {</span><br><span class="line"> completion(nil,[NSError errorWithDomain:NSURLErrorDomain code:@"400" userInfo:@{NSLocalizedDescriptionKey:@"内部数据库打开失败"}]);</span><br><span class="line"> }</span><br><span class="line"> }</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="项目地址"><a href="#项目地址" class="headerlink" title="项目地址"></a>项目地址</h1><p><a href="https://github.com/reference/org_division">Division</</summary>
<category term="sql" scheme="http://example.com/tags/sql/"/>
</entry>
<entry>
<title>ArcGis 地图标记和自定义弹出框</title>
<link href="http://example.com/2020/12/31/ArcGis-%E5%9C%B0%E5%9B%BE%E6%A0%87%E8%AE%B0%E5%92%8C%E8%87%AA%E5%AE%9A%E4%B9%89%E5%BC%B9%E5%87%BA%E6%A1%86/"/>
<id>http://example.com/2020/12/31/ArcGis-%E5%9C%B0%E5%9B%BE%E6%A0%87%E8%AE%B0%E5%92%8C%E8%87%AA%E5%AE%9A%E4%B9%89%E5%BC%B9%E5%87%BA%E6%A1%86/</id>
<published>2020-12-31T06:47:19.000Z</published>
<updated>2020-12-31T06:55:04.798Z</updated>
<content type="html"><![CDATA[<h1 id="AGSPictureMarkerSymbol-标记"><a href="#AGSPictureMarkerSymbol-标记" class="headerlink" title="AGSPictureMarkerSymbol 标记"></a>AGSPictureMarkerSymbol 标记</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">- (AGSGraphic *)pinAtPoint:(AGSPoint *)point info:(NSDictionary *)info</span><br><span class="line">{</span><br><span class="line"> //要展示的图片</span><br><span class="line"> UIImage *image = __IMG(@"icon-forum");</span><br><span class="line"> AGSPictureMarkerSymbol *pictureMarkerSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImage:image];</span><br><span class="line"> pictureMarkerSymbol.width =</span><br><span class="line"> pictureMarkerSymbol.height = 20;</span><br><span class="line"> //设置属性值 用于传参 在代理方法中可以获取到</span><br><span class="line"> AGSGraphic *graphic = [AGSGraphic graphicWithGeometry:point symbol:pictureMarkerSymbol attributes:info];</span><br><span class="line"> // Add polygon graphic to graphics overlay.</span><br><span class="line"> [self.graphicsOverlay.graphics addObject:graphic];</span><br><span class="line"> return graphic;</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p>调用</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">for (YXForumDataInfoModel *m in ms) {</span><br><span class="line"> CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(m.lat,m.lon);//纬度,经度</span><br><span class="line"> [[BDArcGISUtil ins] pinAtPoint:[AGSPoint pointWithCLLocationCoordinate2D:coords] info:[m yy_modelToJSONObject]];</span><br><span class="line"> }</span><br></pre></td></tr></table></figure><h1 id="AGSMapView的callout"><a href="#AGSMapView的callout" class="headerlink" title="AGSMapView的callout"></a>AGSMapView的callout</h1><p>为实现点击标点位置的点击,使用AGSMapView的如下回调</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">/** Tells the delegate that the user single-tapped at the specified location.</span><br><span class="line"> @param geoView on which the user performed the interaction.</span><br><span class="line"> @param screenPoint Location where the user tapped in screen coordinates.</span><br><span class="line"> @param mapPoint Location where the user tapped in map coordinates.</span><br><span class="line"> @since 100</span><br><span class="line"> */</span><br><span class="line">- (void)geoView:(AGSGeoView *)geoView didTapAtScreenPoint:(CGPoint)screenPoint mapPoint:(AGSPoint *)mapPoint;</span><br></pre></td></tr></table></figure><p>为监测点击的区域是否打点区域,使用AGSMapView的如下方法</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">/** Identify (hit-test) which graphics appear at the specified screen coordinates in the provided graphics overlay.</span><br><span class="line"> @param graphicsOverlay in which to identify graphics</span><br><span class="line"> @param screenPoint at which to identify graphics</span><br><span class="line"> @param tolerance radius in points specifying how precise the identify operation should be. A value of 0 means that it should be extremely precise - only those graphics appearing at the exact coordinates should be returned. A value of 22 (a good default for touch displays which covers an average finger tap) means graphics appearing within a 44 pt buffer can also be returned. Max value permitted is 100.</span><br><span class="line"> @param returnPopupsOnly specifies what the identify results should contain. If set to YES, only overlays with popups will be retured. If set to NO, all overlays (with or without popups) will be retured.</span><br><span class="line"> @param maximumResults that should be returned as the result</span><br><span class="line"> @param completion block that is invoked when the operation is complete with the result.</span><br><span class="line"> @return operation which can be canceled</span><br><span class="line"> @since 100</span><br><span class="line"> */</span><br><span class="line">-(id<AGSCancelable>)identifyGraphicsOverlay:(AGSGraphicsOverlay*)graphicsOverlay</span><br><span class="line"> screenPoint:(CGPoint)screenPoint</span><br><span class="line"> tolerance:(double)tolerance</span><br><span class="line"> returnPopupsOnly:(BOOL)returnPopupsOnly</span><br><span class="line"> maximumResults:(NSInteger)maximumResults</span><br><span class="line"> completion:(void(^)(AGSIdentifyGraphicsOverlayResult *identifyResult))completion;</span><br></pre></td></tr></table></figure><p>案例</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">#pragma mark Tap</span><br><span class="line"></span><br><span class="line">- (void)geoView:(AGSGeoView *)geoView didTapAtScreenPoint:(CGPoint)screenPoint mapPoint:(AGSPoint *)mapPoint</span><br><span class="line">{</span><br><span class="line"> [geoView identifyGraphicsOverlay:geoView.graphicsOverlays.firstObject screenPoint:screenPoint tolerance:12 returnPopupsOnly:NO maximumResults:1000 completion:^(AGSIdentifyGraphicsOverlayResult * _Nonnull identifyResult) {</span><br><span class="line"> if (identifyResult.error) {</span><br><span class="line"> NSLog(@"error %@",identifyResult.error.localizedDescription);</span><br><span class="line"> }else{</span><br><span class="line"> NSMutableArray *forumDataInfoModels = [NSMutableArray array];</span><br><span class="line"> //获得锚点的信息</span><br><span class="line"> for (AGSGraphic *graphic in identifyResult.graphics) {</span><br><span class="line"> NSLog(@"info %@",graphic.attributes);</span><br><span class="line"> YXForumDataInfoModel *m = [YXForumDataInfoModel yy_modelWithJSON:[graphic.attributes yy_modelToJSONObject]];</span><br><span class="line"> [forumDataInfoModels addObject:m];</span><br><span class="line"> }</span><br><span class="line"> </span><br><span class="line"> // if info is exsit 弹出框</span><br><span class="line"> if (forumDataInfoModels.count) {</span><br><span class="line"> //callout</span><br><span class="line"> GPHomeMapCalloutView *customView = [UINib viewForNib:NSStringFromClass(GPHomeMapCalloutView.class)];</span><br><span class="line"> //set data</span><br><span class="line"> customView.forumDataInfoModels = forumDataInfoModels;</span><br><span class="line"> // add new</span><br><span class="line"> customView.didAddNew = ^(AGSPoint * _Nonnull point) {</span><br><span class="line"> addNewForum(point);</span><br><span class="line"> };</span><br><span class="line"> //did select item</span><br><span class="line"> customView.didSelectForum = ^(YXForumDataInfoModel * _Nonnull forumInfoModel) {</span><br><span class="line"> // dismiss callout</span><br><span class="line"> [geoView.callout dismiss];</span><br><span class="line"> // build a forum list model</span><br><span class="line"> YXFormListModel *flm = [YXFormListModel new];</span><br><span class="line"> flm.uuid = forumInfoModel.uuid;</span><br><span class="line"> //goto forum detail</span><br><span class="line"> [GPForumJumper jumpToForumWithType:[NSString stringWithFormat:@"%li",forumInfoModel.type] fromViewController:self taskModel:nil projectModel:nil point:mapPoint interfaceStatus:InterfaceStatus_Show forum:flm table:nil];</span><br><span class="line"> };</span><br><span class="line"> //add customer view</span><br><span class="line"> self.mapView.callout.customView = customView;</span><br><span class="line"> //show callout</span><br><span class="line"> [self.mapView.callout showCalloutAt:mapPoint screenOffset:CGPointZero rotateOffsetWithMap:YES animated:YES];</span><br><span class="line"> }</span><br><span class="line"> else{</span><br><span class="line"> [geoView.callout dismiss];</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> }];</span><br><span class="line">}</span><br><span class="line"></span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="AGSPictureMarkerSymbol-标记"><a href="#AGSPictureMarkerSymbol-标记" class="headerlink" title="AGSPictureMarkerSymbol 标记"></a>AGSPictureM</summary>
<category term="ArcGis callout" scheme="http://example.com/tags/ArcGis-callout/"/>
</entry>
<entry>
<title>UITextField 输入空格和删除键的处理</title>
<link href="http://example.com/2020/12/31/UITextField-%E8%BE%93%E5%85%A5%E7%A9%BA%E6%A0%BC%E5%92%8C%E5%88%A0%E9%99%A4%E9%94%AE%E7%9A%84%E5%A4%84%E7%90%86/"/>
<id>http://example.com/2020/12/31/UITextField-%E8%BE%93%E5%85%A5%E7%A9%BA%E6%A0%BC%E5%92%8C%E5%88%A0%E9%99%A4%E9%94%AE%E7%9A%84%E5%A4%84%E7%90%86/</id>
<published>2020-12-30T16:11:26.000Z</published>
<updated>2020-12-30T16:14:07.407Z</updated>
<content type="html"><![CDATA[<h1 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h1><p> 有时候为了控制输入,需要在delegate中实现控制。上代码</p><h1 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">#pragma mark - textfield delegate</span><br><span class="line"></span><br><span class="line">- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string</span><br><span class="line">{</span><br><span class="line"> //删除</span><br><span class="line"> if ([string isEqualToString:@""]) {</span><br><span class="line"> if (textField.text.length == 1) {</span><br><span class="line">//TODO:handle your stuff</span><br><span class="line">return YES;</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> //空格</span><br><span class="line"> if ([string isEqualToString:@" "]) {</span><br><span class="line"> textField.text = [textField.text trim];</span><br><span class="line"> return NO;</span><br><span class="line"> }</span><br><span class="line"> //TODO:handle your stuff</span><br><span class="line"> return YES;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h1><p> 有时候为了控制输入,需要在delegate中实现控制。上代码</p>
<h1 id="代码"><a href="#代码" clas</summary>
<category term="UITextField" scheme="http://example.com/tags/UITextField/"/>
</entry>
</feed>