ffi 1.26: uikit_chdir_to_bundle via #objc_call

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.
This commit is contained in:
agra
2026-05-19 19:30:59 +03:00
parent bcbf2ace22
commit 3518d0ee26

View File

@@ -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));
}