Here’s Ethan’s Life, where I share articles, photos and ideas. By @e1hanw0ng.
NSWindow 有一个属性叫做 releasedWhenClosed 默认值为 YES 表示 close 调用会把自己释放掉。如果有逻辑持有了 window 的引用,随后在 close 之后的某个时候将它释放了,就会出现 double release 导致程序挂掉😔

#TIL@gettoset_channel
256G 的 Mac Mini 是真的搞不得 iOS 开发,虽然还没过保,还是下决心换了 1T 硬盘,整个流程还是比较繁琐的。不过还算顺利。

#life@gettoset_channel
🎞️ 将今年上半年拍摄的四卷胶片照片更新到了我的相册上。

https://gallery.ethanwong.me

这几卷胶片的拍摄其实都不算太顺利,新相机的首次磨合适应、因为操作失误导致底片有折痕,以及意外摔掉了相机导致片仓被打开……

今年因为一些种种的烦心事,无论是通过照片还是文字记录和分享生活的欲望变得很低。

这些胶片照片记录了这半年来很难忘的一些经历,包括与朋友相聚、告别、探索新的旧的咖啡店、三月份的 Can Festival、四月份在东京和香港的旅行,以及五月份的越位音乐节。

#life@gettoset_channel
Ethan’s Life
🔗 Objective-C Direct Methods https://nshipster.com/direct/
查问题逆向之后打算 swizzle 一个 Objc 方法,发现它不能被 performSelector 调用,仔细看汇编发现竟然是静态派发的。研究了一圈才知道有 direct method 这种特性。🤯

#TIL@gettoset_channel
Ethan’s Life
🔗 The First Time I Was Almost Fired From Apple https://www.engineersneedart.com/blog/almostfired/almostfired.html
有时候还挺费解为什么 Mac 的 Color Picker 会有“蜡笔”面板,原来是工程师自娱自乐的产物。

> On a roll, I decided to also knock out a “crayon picker”. At this point, to be clear, the color picker was working and I felt I understood it well enough. As I say, I was kind of just having some fun now.

> And I wrote the crayon picker because it seemed to me to be the kind of thing Apple was all about: HSL, RGB — these were kind of nerdy color spaces — a box of crayons is how the rest of us picked colors.
Ethan’s Life
Apple 自己也犯了忘记设置 clipToBounds = false 的问题🤣
NSView 被改成默认不 clip 以后,有些控件的默认行为是有些困惑的,比如 textField 的 … 后面有时候还能展示出文字。
Apple 自己也犯了忘记设置 clipToBounds = false 的问题🤣
调试问题的时候偶然发现,macOS Tahoe 上一些常见的 AppKit 控件比如 NSButton 竟然是 SwiftUI 绘制的🤯
🔗 2nd Japanniversary
https://lmnt.me/blog/second-japanniversary.html

> Connecting with Japanese people is still a bit tough. Most people need a very long time to warm up. On the plus side, I've met other foreigners who connect almost instantly. We’re sharing things about each other in the first hour that I still can’t seem to with my Japanese friends after two years.
Xcode 26 从 beta 1 升级到 beta 2 以后,在设置里看不到 beta 1 的模拟器也无法卸载它。似乎模拟器安装的位置受 SIP 保护,如果升级之前忘记卸载旧的模拟器想要 reclaim 这 10GB 的空间,还得先把 beta 1 的 Xcode 安装回来才行😞
Back to Top