diff --git a/src/AppKit/NSTextContainer.cs b/src/AppKit/NSTextContainer.cs
index 60a1674f96d6..5bd9a2c204b4 100644
--- a/src/AppKit/NSTextContainer.cs
+++ b/src/AppKit/NSTextContainer.cs
@@ -1,50 +1,50 @@
#if !__MACCATALYST__ // there's a version in UIKit, use that one instead
using System;
+
using CoreGraphics;
+using Foundation;
using ObjCRuntime;
#nullable enable
namespace AppKit {
public partial class NSTextContainer {
-#if !NET
- [Obsoleted (PlatformName.MacOSX, 10, 11, message: "Use NSTextContainer.FromSize instead.")]
- public NSTextContainer (CGSize size)
- {
- Handle = InitWithContainerSize (size);
- }
-#endif // !NET
-
+ [SupportedOSPlatform ("macos")]
+ [ObsoletedOSPlatform ("macos", "Use 'new NSTextContainer (CGSize)' instead.")]
+ [UnsupportedOSPlatform ("ios")]
+ [UnsupportedOSPlatform ("maccatalyst")]
+ [UnsupportedOSPlatform ("tvos")]
internal NSTextContainer (CGSize size, bool isContainer)
+ : base (NSObjectFlag.Empty)
{
- if (isContainer)
- Handle = InitWithContainerSize (size);
- else
- Handle = InitWithSize (size);
+ if (isContainer) {
+ InitializeHandle (_InitWithContainerSize (size), "initWithContainerSize:");
+ } else {
+ InitializeHandle (_InitWithSize (size), "initWithSize:");
+ }
}
- /// To be added.
- /// To be added.
- /// To be added.
- /// To be added.
+ /// Create a new with the specified size.
+ /// The size of the new .
+ /// A new with the specified size.
[SupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
public static NSTextContainer FromSize (CGSize size)
{
- return new NSTextContainer (size, false);
+ return new NSTextContainer (size);
}
- /// To be added.
- /// To be added.
- /// To be added.
- /// To be added.
- [UnsupportedOSPlatform ("ios")]
+ /// Create a new with the specified size.
+ /// The size of the new .
+ /// A new with the specified size.
+ /// This method is deprecated, use instead.
[SupportedOSPlatform ("macos")]
+ [ObsoletedOSPlatform ("macos", "Use 'new NSTextContainer (CGSize)' instead.")]
+ [UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
- [ObsoletedOSPlatform ("macos", "Use NSTextContainer.FromSize instead.")]
public static NSTextContainer FromContainerSize (CGSize containerSize)
{
return new NSTextContainer (containerSize, true);
diff --git a/src/xkit.cs b/src/xkit.cs
index 95dc60c01fab..0094483018b5 100644
--- a/src/xkit.cs
+++ b/src/xkit.cs
@@ -3795,25 +3795,25 @@ NSTextLayoutOrientation LayoutOrientation {
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
partial interface NSTextContainer : NSTextLayoutOrientationProvider, NSSecureCoding {
- [NoMac]
[MacCatalyst (13, 1)]
[DesignatedInitializer]
[Export ("initWithSize:")]
NativeHandle Constructor (CGSize size);
+ [Deprecated (PlatformName.MacOSX, 10, 11, "Use 'new NSTextContainer (CGSize)' instead.")]
[NoiOS]
[NoMacCatalyst]
[NoTV]
[Export ("initWithContainerSize:"), Internal]
[Sealed]
- IntPtr InitWithContainerSize (CGSize size);
+ IntPtr _InitWithContainerSize (CGSize size);
[NoiOS]
[NoMacCatalyst]
[NoTV]
[Export ("initWithSize:"), Internal]
[Sealed]
- IntPtr InitWithSize (CGSize size);
+ IntPtr _InitWithSize (CGSize size);
[NullAllowed] // by default this property is null
[Export ("layoutManager", ArgumentSemantic.Assign)]
diff --git a/tests/cecil-tests/ConstructorTest.KnownFailures.cs b/tests/cecil-tests/ConstructorTest.KnownFailures.cs
index 355c3ad29f3c..9654ecf39fd2 100644
--- a/tests/cecil-tests/ConstructorTest.KnownFailures.cs
+++ b/tests/cecil-tests/ConstructorTest.KnownFailures.cs
@@ -7,7 +7,6 @@ public partial class ConstructorTest {
static HashSet knownFailuresNonDefaultCtorDoesNotCallBaseDefaultCtor = new HashSet {
"AppKit.ActionDispatcher::.ctor(System.EventHandler)",
"AppKit.NSAlertDidEndDispatcher::.ctor(System.Action`1)",
- "AppKit.NSTextContainer::.ctor(CoreGraphics.CGSize,System.Boolean)",
"AVFoundation.InternalAVAudioSessionDelegate::.ctor(AVFoundation.AVAudioSession)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[],System.String,System.String)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[])",
diff --git a/tests/cecil-tests/SetHandleTest.KnownFailures.cs b/tests/cecil-tests/SetHandleTest.KnownFailures.cs
index 5b79b7b40bae..82d710a2b87d 100644
--- a/tests/cecil-tests/SetHandleTest.KnownFailures.cs
+++ b/tests/cecil-tests/SetHandleTest.KnownFailures.cs
@@ -9,7 +9,6 @@ public partial class SetHandleTest {
"AppKit.NSBitmapImageRep::.ctor(Foundation.NSObjectFlag,Foundation.NSObjectFlag)",
"AppKit.NSOpenGLPixelFormat::.ctor(AppKit.NSOpenGLPixelFormatAttribute[])",
"AppKit.NSOpenGLPixelFormat::.ctor(System.Object[])",
- "AppKit.NSTextContainer::.ctor(CoreGraphics.CGSize,System.Boolean)",
"CoreFoundation.CFMutableString::.ctor(CoreFoundation.CFString,System.IntPtr)",
"CoreFoundation.CFMutableString::.ctor(System.String,System.IntPtr)",
"CoreFoundation.CFSocket::Initialize(CoreFoundation.CFRunLoop,CoreFoundation.CFSocket/CreateSocket)",
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
index 918ee6bcae18..db01e775331a 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
@@ -59,6 +59,9 @@
!incorrect-protocol-member! +NSPasteboardReading::readableTypesForPasteboard: is REQUIRED and should be abstract
!incorrect-protocol-member! +NSWindowRestoration::restoreWindowWithIdentifier:state:completionHandler: is REQUIRED and should be abstract
+# This init method is bound manually, because the managed signature is identical to another init method.
+!missing-selector! NSTextContainer::initWithContainerSize: not bound
+
## unsorted
!missing-enum! NSWritingDirectionFormatType not bound
@@ -133,8 +136,6 @@
!missing-selector! NSMutableAttributedString::fixAttributesInRange: not bound
!missing-selector! NSString::boundingRectWithSize:options:attributes: not bound
!missing-selector! NSString::drawWithRect:options:attributes: not bound
-!missing-selector! NSTextContainer::initWithContainerSize: not bound
-!missing-selector! NSTextContainer::initWithSize: not bound
!missing-selector! NSTextContainer::lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect: not bound
!missing-selector! NSTextStorage::attributeRuns not bound
!missing-selector! NSTextStorage::characters not bound