From 3518d0ee266283d33e8f2cdde0f0652955f13fd6 Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 19 May 2026 19:30:59 +0300 Subject: [PATCH] ffi 1.26: uikit_chdir_to_bundle via #objc_call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Second Phase 1D cluster. NSBundle.mainBundle.resourcePath chain now dispatches through `#objc_call(*void)` instead of a shared `msg_o` typed cast — covers both class-method (`+mainBundle`) and instance-method (`-resourcePath`) shapes through one intrinsic. Net -3 lines. iOS-sim chess regression smoke: app launches with all piece assets rendered, which is the visible signal that `chdir` to the bundle's resource path still succeeds. --- library/modules/platform/uikit.sx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/library/modules/platform/uikit.sx b/library/modules/platform/uikit.sx index 6cd0506..07d5bcf 100644 --- a/library/modules/platform/uikit.sx +++ b/library/modules/platform/uikit.sx @@ -276,11 +276,8 @@ uikit_refresh_safe_insets :: (plat: *UIKitPlatform) { uikit_chdir_to_bundle :: () { inline if OS != .ios { return; } NSBundle := objc_getClass("NSBundle".ptr); - sel_main_bundle := sel_registerName("mainBundle".ptr); - sel_resource_path := sel_registerName("resourcePath".ptr); - msg_o : (*void, *void) -> *void = xx objc_msgSend; - bundle := msg_o(NSBundle, sel_main_bundle); - rsrc := msg_o(bundle, sel_resource_path); + bundle := #objc_call(*void)(NSBundle, "mainBundle"); + rsrc := #objc_call(*void)(bundle, "resourcePath"); if rsrc == null { return; } chdir(c_string(rsrc)); }