Skip to content

Commit 413089e

Browse files
committed
介绍检测循环引用的工具。
1 parent 231d3a3 commit 413089e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

01《招聘一个靠谱的iOS》面试题参考答案/《招聘一个靠谱的iOS》面试题参考答案(下).md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ autoreleasepool 以一个队列数组的形式实现,主要通过下列三个函
651651
652652
或者将其中一方强制制空 `xxx = nil`。
653653
654+
检测代码中是否存在循环引用问题,可使用 Facebook 开源的一个检测工具 [***FBRetainCycleDetector***](https://github.com/facebook/FBRetainCycleDetector) 。
655+
654656
###38. 在block内如何修改block外部变量?
655657
默认情况下,在block中访问的外部变量是复制过去的,即:**写操作不对原变量生效**。但是你可以加上`__block`来让其写操作生效,示例代码如下:
656658
@@ -720,6 +722,7 @@ __typeof__(self) strongSelf = weakSelf;
720722
```
721723
self --> _observer --> block --> self 显然这也是一个循环引用。
722724

725+
检测代码中是否存在循环引用问题,可使用 Facebook 开源的一个检测工具 [***FBRetainCycleDetector***](https://github.com/facebook/FBRetainCycleDetector)
723726
###40. GCD的队列(`dispatch_queue_t`)分哪两种类型?
724727

725728

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# iOSInterviewQuestions(面试题学习交流群:541317935
1+
# iOSInterviewQuestions(面试题学习交流群:561873398
22
iOS面试题集锦(附答案)
33

44

0 commit comments

Comments
 (0)