objc: NSString type + Into(*NSString) for string

Adds an NSString foreign class and impl Into(*NSString) for string so a string literal flows into any *NSString slot via xx. uikit's keyboard userInfo lookups now read objectForKey(xx "...") instead of ns_string("...".ptr), and objectForKey's key param is retyped *NSString.

ffi-objc-call-06 .ir snapshot regenerated: declaring the NSString type adds its reflection thunks (struct_to_string/pointer_to_string), same as the existing NSObject/NSDictionary. Runtime output unchanged.
This commit is contained in:
agra
2026-05-30 17:39:38 +03:00
parent 29a4891374
commit 8e3c3ae981
3 changed files with 998 additions and 866 deletions

View File

@@ -75,7 +75,7 @@ NSNumber :: #foreign #objc_class("NSNumber") {
NSDictionary :: #foreign #objc_class("NSDictionary") {
#extends NSObject;
objectForKey :: (self: *Self, key: *void) -> *void;
objectForKey :: (self: *Self, key: *NSString) -> *void;
}
NSMutableDictionary :: #foreign #objc_class("NSMutableDictionary") {
@@ -563,19 +563,19 @@ impl Platform for UIKitPlatform {
user_info := notification.userInfo();
if user_info == null { return; }
end_value_raw := user_info.objectForKey(ns_string("UIKeyboardFrameEndUserInfoKey".ptr));
end_value_raw := user_info.objectForKey(xx "UIKeyboardFrameEndUserInfoKey");
if end_value_raw == null { return; }
end_value : *NSValue = xx end_value_raw;
end_rect := end_value.CGRectValue();
dur_value_raw := user_info.objectForKey(ns_string("UIKeyboardAnimationDurationUserInfoKey".ptr));
dur_value_raw := user_info.objectForKey(xx "UIKeyboardAnimationDurationUserInfoKey");
anim_dur : f64 = 0.0;
if dur_value_raw != null {
dur_value : *NSNumber = xx dur_value_raw;
anim_dur = dur_value.doubleValue();
}
curve_value_raw := user_info.objectForKey(ns_string("UIKeyboardAnimationCurveUserInfoKey".ptr));
curve_value_raw := user_info.objectForKey(xx "UIKeyboardAnimationCurveUserInfoKey");
curve_int : u64 = 0;
if curve_value_raw != null {
curve_value : *NSNumber = xx curve_value_raw;