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:
@@ -276,11 +276,8 @@ uikit_refresh_safe_insets :: (plat: *UIKitPlatform) {
|
|||||||
uikit_chdir_to_bundle :: () {
|
uikit_chdir_to_bundle :: () {
|
||||||
inline if OS != .ios { return; }
|
inline if OS != .ios { return; }
|
||||||
NSBundle := objc_getClass("NSBundle".ptr);
|
NSBundle := objc_getClass("NSBundle".ptr);
|
||||||
sel_main_bundle := sel_registerName("mainBundle".ptr);
|
bundle := #objc_call(*void)(NSBundle, "mainBundle");
|
||||||
sel_resource_path := sel_registerName("resourcePath".ptr);
|
rsrc := #objc_call(*void)(bundle, "resourcePath");
|
||||||
msg_o : (*void, *void) -> *void = xx objc_msgSend;
|
|
||||||
bundle := msg_o(NSBundle, sel_main_bundle);
|
|
||||||
rsrc := msg_o(bundle, sel_resource_path);
|
|
||||||
if rsrc == null { return; }
|
if rsrc == null { return; }
|
||||||
chdir(c_string(rsrc));
|
chdir(c_string(rsrc));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user