😇

Undefined symbol: __mh_execute_header

に公開

https://qiita.com/miyu1000waltz/items/701e3c1b3d342e2eb1dd

こちらでは _mh_execute_header ではなく _mh_dylib_header を使用するようにと書かれているが、Debugプロファイルでは正しく動くがReleaseプロファイルでは正しく動かない問題があった。

ChatGPT o3に質問したところ、以下のコードでどちらも共通で使用できることが分かった。

extern const struct mach_header __dso_handle;

...

UnityFramework* ufw = [bundle.principalClass getInstance];
if (![ufw appController])
{
    [ufw setExecuteHeader:(const struct mach_header *)&__dso_handle];
}

Discussion