[Foundation] Improve NSArray.StringArrayFromHandle a bit.#24640
Conversation
* Enable nullability. * Call the equivalent CFArray.StringArrayFromHandle to reuse existing (and faster) code. * Since a better alternative exists (CFArray.StringArrayFromHandle), remove this method in XAMCORE_5_0. Contributes towards #17285.
…tringarrayfromhandle
There was a problem hiding this comment.
Pull request overview
This PR improves the NSArray.StringArrayFromHandle method by enabling nullability, improving performance by delegating to CFArray.StringArrayFromHandle, and scheduling its removal in XAMCORE_5_0. This contributes to the broader effort tracked in issue #17285 to add nullability to Foundation base types.
Changes:
- Enabled nullability for
NSArray.StringArrayFromHandlewith proper nullable annotations (string? []?) - Delegated implementation to
CFArray.StringArrayFromHandlefor better performance - Wrapped method in
#if !XAMCORE_5_0to schedule removal in version 5.0 - Updated
RegistrarHelper.NSArray_string_native_to_managedsignature to match new nullability annotations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Foundation/NSArray.cs | Enabled nullability for StringArrayFromHandle, delegated to CFArray implementation, improved documentation, and scheduled removal in XAMCORE_5_0 |
| src/ObjCRuntime/RegistrarHelper.cs | Updated parameter signature from string []? to string? []? to reflect that array elements can be nullable |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #7f685d9] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #7f685d9] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build #7f685d9] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #7f685d9] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #7f685d9] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #7f685d9] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #7f685d9] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #7f685d9] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
🚀 [CI Build #7f685d9] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Contributes towards #17285.