iOS-Source-Probe icon indicating copy to clipboard operation
iOS-Source-Probe copied to clipboard

🔎 iOS 源码探求系列

Results 6 iOS-Source-Probe issues
Sort by recently updated
recently updated
newest added

建议采用 MachOView 看下 magic 的值,并非 magic = 0xcafebabe,而是 magic = 0xbebafeca,FAT_CIGAM。 这个涉及到内存大小端问题。官方文档对此也有详细的解释,参考官文: https://developer.apple.com/documentation/kernel/fat_header。iOS 是小端模式。

```c++ // Prevent a deadlock between the weak reference machinery // and the +initialize machinery by ensuring that no // weakly-referenced object has an un-+initialized isa. if (haveNew && newObj)...

问题
勘误

![image](https://user-images.githubusercontent.com/10513969/62097630-0dff3100-b2ba-11e9-88c7-bde2f2bc3186.png) 如图所示,作者所讲 LC_DYSYMTAB 的offset是基于_LINKEDIT 段的,我认为这并不准确。__PAGEZERO的VMAdrees起止为0x00 ~ 0x100000000,段的offset是相对于0x100000000,即__PAGEZERO段的虚拟空间大小,如下图: ![image](https://user-images.githubusercontent.com/10513969/62098071-80bcdc00-b2bb-11e9-89d8-4c141d54d77c.png) ![image](https://user-images.githubusercontent.com/10513969/62098135-c4afe100-b2bb-11e9-955d-08d5b6dc72de.png) ![image](https://user-images.githubusercontent.com/10513969/62098148-d09ba300-b2bb-11e9-96be-e1ce188ba979.png)

问题

看了你这篇 [《weak 弱引用的实现方式》](https://github.com/Desgard/iOS-Source-Probe/blob/master/Objective-C/Runtime/weak%20%E5%BC%B1%E5%BC%95%E7%94%A8%E7%9A%84%E5%AE%9E%E7%8E%B0%E6%96%B9%E5%BC%8F.md) 文章 ,里面提到 : > “单步运行,发现会跳入 NSObject.mm 中的 objc_initWeak() 这个方法。在进行编译过程前,clang 其实对 __weak 做了转换,将声明方式做出了如下调整。” 我想问下 你是怎么知道 调用 `objc_initWeak` 这个函数的? 我自己尝试着 `clang`, 转换的代码如下: ```objc //转换前 { NSObject *obj = [[NSObject...

问题
勘误
文章待修正

首先感谢你的分享,对sdwebimage分析的很好,能不能把带有中文详细注释的sdwebimage v3.8.1发布出来?

问题