[UIKit] The default UIDocViewController constructor is unusable, so prevent any usage.
This commit is contained in:
Родитель
b7d3e54f26
Коммит
30201b38ca
|
@ -9,6 +9,8 @@
|
|||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
@ -207,4 +209,19 @@ namespace UIKit {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !XAMCORE_5_0 && IOS
|
||||
public partial class UIDocViewController {
|
||||
[Obsolete ("Do not use; this constructor doesn't work.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public UIDocViewController ()
|
||||
: base (ThrowInvalidOperationException ())
|
||||
{
|
||||
}
|
||||
static NSObjectFlag ThrowInvalidOperationException ()
|
||||
{
|
||||
throw new InvalidOperationException ("Do not call this constructor, it may crash the app.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -28127,8 +28127,10 @@ namespace UIKit {
|
|||
}
|
||||
|
||||
[NoWatch, NoTV, iOS (17, 0), MacCatalyst (17, 0)]
|
||||
[DisableDefaultCtor] // It crashes the app.
|
||||
#if XAMCORE_5_0
|
||||
[BaseType (typeof(UIViewController))]
|
||||
[Abstract] // "UIDocumentViewController is an abstract base class that is meant to be subclassed."
|
||||
interface UIDocumentViewController
|
||||
#else
|
||||
[BaseType (typeof (UIViewController), Name = "UIDocumentViewController")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче