Skip to content

Commit c72b7de

Browse files
author
Draveness
committed
Remove redundant link and add follow link in the end
1 parent f6934b0 commit c72b7de

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

libextobjc/如何在 Objective-C 的环境下实现 defer.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# 如何在 Objective-C 的环境下实现 defer
22

3-
> 关注仓库,及时获得更新:[iOS-Source-Code-Analyze](https://github.com/draveness/iOS-Source-Code-Analyze)
4-
>
5-
> Follow: [Draveness · Github](https://github.com/Draveness)
6-
73
这篇文章会对 [libextobjc](https://github.com/jspahrsummers/libextobjc) 中的一小部分代码进行分析,也是**如何扩展 Objective-C 语言**系列文章的第一篇,笔者会从 libextobjc 中选择一些黑魔法进行介绍。
84

95
对 Swift 稍有了解的人都知道,`defer` 在 Swift 语言中是一个关键字;在 `defer` 代码块中的代码,会**在作用域结束时执行**。在这里,我们会使用一些神奇的方法在 Objective-C 中实现 `defer`
@@ -152,7 +148,6 @@ __strong ext_cleanupBlock_t ext_exitBlock_19 __attribute__((cleanup(ext_executeC
152148
153149
libextobjc 将 `cleanup` 这一变量属性,很好地包装成了 `@onExit`,它的实现也是比较有意思的,也激起了笔者学习 GCC 编译命令并且阅读一些文档的想法。
154150

155-
156-
151+
> Follow: [Draveness · Github](https://github.com/Draveness)
157152
158153

0 commit comments

Comments
 (0)