KEMBAR78
[release/9.0.1xx] [UIKit] Make sure to invoke the correct constructor. by dalexsoto · Pull Request #23131 · dotnet/macios · GitHub
Skip to content

Conversation

dalexsoto
Copy link
Member

Backport of #23127

Fixes #23122

There are three constructors involved here:

  1. (UIBarButtonSystemItem systemItem, EventHandler handler)
  2. (UIBarButtonSystemItem systemItem, NSObject target, Selector action)
  3. (UIBarButtonSystemItem systemItem, UIAction primaryAction, UIMenu menu)

The first constructor is a manually written convenience constructor, and needs
to call another constructor. Either the second or the third constructor works,
but the third constructor is only available on iOS 16+, while the second is
available on all iOS version.

This means that calling the third constructor is a bad idea, because it won't
work on anything before iOS 16. Unfortunately that's exactly what we did.

So change the code to call the second constructor instead.

This is a regression that was introduced in
f431538.

Fixes #23122.

…23127)

There are three constructors involved here:

1. (UIBarButtonSystemItem systemItem, EventHandler handler)
2. (UIBarButtonSystemItem systemItem, NSObject target, Selector action)
3. (UIBarButtonSystemItem systemItem, UIAction primaryAction, UIMenu
menu)

The first constructor is a manually written convenience constructor, and
needs
to call another constructor. Either the second or the third constructor
works,
but the third constructor is only available on iOS 16+, while the second
is
available on all iOS version.

This means that calling the third constructor is a bad idea, because it
won't
work on anything before iOS 16. Unfortunately that's exactly what we
did.

So change the code to call the second constructor instead.

This is a regression that was introduced in
f431538.

Fixes #23122.
@dalexsoto dalexsoto requested a review from rolfbjarne as a code owner June 23, 2025 17:17
@dalexsoto dalexsoto changed the title [UIKit] Make sure to invoke the correct constructor. [release/9.0.1xx][UIKit] Make sure to invoke the correct constructor. Jun 23, 2025
@dalexsoto dalexsoto changed the title [release/9.0.1xx][UIKit] Make sure to invoke the correct constructor. [release/9.0.1xx] [UIKit] Make sure to invoke the correct constructor. Jun 23, 2025
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #134a841] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #134a841] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

✅ API diff vs stable

.NET ( No breaking changes )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #134a841] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #134a841] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #134a841] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #134a841] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #134a841] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #134a841] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 119 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 10 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 134a841a7652fef76fe5644fa1da00b2e76d4c67 [PR build]

@dalexsoto dalexsoto merged commit ccbf66b into release/9.0.1xx Jun 23, 2025
44 checks passed
@dalexsoto dalexsoto deleted the dev/alex/9backport branch June 23, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants