Custom controls are not imported in .h file when generating XCode prj
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by reproducing the issue with the xcsync generate command using the shown PrimaryButton outlet, then trace how it generates ViewController.h and determines imports. Done means the generated header imports the file defining PrimaryButton and a subsequent sync preserves the custom outlet.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Apple platform
macOS
Framework version
Other
Describe the bug
If I have such a custom control
[Register("PrimaryButton")]
public class PrimaryButton : NSButton
{
public PrimaryButton(NativeHandle handle) : base(handle)
{
Initialize();
}
private void Initialize()
{
SetButtonType(NSButtonType.MomentaryPushIn);
UpdateBezelColor();
}
private void UpdateBezelColor() => BezelColor = Enabled ? NSColor.ControlAccent : null;
public override bool Enabled
{
get => base.Enabled;
set
{
base.Enabled = value;
UpdateBezelColor();
}
}
}
and later this code
namespace TestCustomControl
{
[Register ("ViewController")]
partial class ViewController
{
[Outlet]
TestCustomControl.PrimaryButton CustomButton { get; set; }
void ReleaseDesignerOutlets ()
{
if (CustomButton != null) {
CustomButton.Dispose ();
CustomButton = null;
}
}
}
}
xcsync generate generates ViewController.h file without import PrimaryButton.
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
@interface ViewController : NSViewController {
PrimaryButton *_CustomButton;
}
@property (nonatomic, retain) IBOutlet PrimaryButton *CustomButton;
@end
This breaks sync command because it cannot probably resolve the PrimaryButton object and it will generate ViewController without PrimaryButton outlet.
Expected Behavior
The .h file is generated with correct import files.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version info
dotnet dotnet --info
.NET SDK:
Version: 10.0.201
Commit: 4d3023de60
Workload version: 10.0.201
MSBuild version: 18.3.0-release-26153-122+4d3023de6
Runtime Environment:
OS Name: Mac OS X
OS Version: 26.4
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/10.0.201/
.NET workloads installed:
[macos]
Installation Source: SDK 10.0.200
Manifest Version: 26.2.10217/10.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/10.0.100/microsoft.net.sdk.macos/26.2.10217/WorkloadManifest.json
Install Type: FileBased
[maui-maccatalyst]
Installation Source: SDK 10.0.200
Manifest Version: 10.0.20/10.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/10.0.100/microsoft.net.sdk.maui/10.0.20/WorkloadManifest.json
Install Type: FileBased
[maccatalyst]
Installation Source: SDK 10.0.200
Manifest Version: 26.2.10217/10.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/10.0.100/microsoft.net.sdk.maccatalyst/26.2.10217/WorkloadManifest.json
Install Type: FileBased
[wasm-tools-net6]
Installation Source: SDK 10.0.200
Manifest Version: 10.0.105/10.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/10.0.100/microsoft.net.workload.mono.toolchain.net6/10.0.105/WorkloadManifest.json
Install Type: FileBased
Anything else?
No response
- Dominant language
- C#
- Stars
- 25
- Forks
- 10
- Avg merge
- 12h 50m
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/xcsync
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·