diff --git a/src/appkit.cs b/src/appkit.cs
index d74e637cf52e..214d2adea06e 100644
--- a/src/appkit.cs
+++ b/src/appkit.cs
@@ -657,21 +657,24 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
NSGraphicsContext Context { get; }
[Export ("hide:")]
- void Hide (NSObject sender);
+ void Hide ([NullAllowed] NSObject sender);
[Export ("unhide:")]
- void Unhide (NSObject sender);
+ void Unhide ([NullAllowed] NSObject sender);
[Export ("unhideWithoutActivation")]
void UnhideWithoutActivation ();
[Export ("windowWithWindowNumber:")]
+ [return: NullAllowed]
NSWindow WindowWithWindowNumber (nint windowNum);
[Export ("mainWindow")]
+ [NullAllowed]
NSWindow MainWindow { get; }
[Export ("keyWindow")]
+ [NullAllowed]
NSWindow KeyWindow { get; }
/// To be added.
@@ -700,10 +703,10 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void ActivateIgnoringOtherApps (bool flag);
[Export ("hideOtherApplications:")]
- void HideOtherApplications (NSObject sender);
+ void HideOtherApplications ([NullAllowed] NSObject sender);
[Export ("unhideAllApplications:")]
- void UnhideAllApplications (NSObject sender);
+ void UnhideAllApplications ([NullAllowed] NSObject sender);
[Export ("finishLaunching")]
void FinishLaunching ();
@@ -715,7 +718,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
nint RunModalForWindow (NSWindow theWindow);
[Export ("stop:")]
- void Stop (NSObject sender);
+ void Stop ([NullAllowed] NSObject sender);
[Export ("stopModal")]
void StopModal ();
@@ -727,6 +730,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void AbortModal ();
[Export ("modalWindow")]
+ [NullAllowed]
NSWindow ModalWindow { get; }
[Export ("beginModalSessionForWindow:")]
@@ -760,6 +764,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void EndSheet (NSWindow sheet, nint returnCode);
[Export ("nextEventMatchingMask:untilDate:inMode:dequeue:"), Protected]
+ [return: NullAllowed]
NSEvent NextEvent (NSEventMask mask, [NullAllowed] NSDate expiration, NSString runLoopMode, bool deqFlag);
// NSEventMask must be casted to nuint to preserve the NSEventMask.Any special value on 64 bit systems. NSEventMask is not [Native].
@@ -771,16 +776,18 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
/// To be added.
/// To be added.
[Wrap ("NextEvent (mask, expiration, runLoopMode.GetConstant ()!, deqFlag)")]
+ [return: NullAllowed]
NSEvent NextEvent (NSEventMask mask, NSDate expiration, NSRunLoopMode runLoopMode, bool deqFlag);
[Export ("discardEventsMatchingMask:beforeEvent:"), Protected]
- void DiscardEvents (nuint mask, NSEvent lastEvent);
+ void DiscardEvents (nuint mask, [NullAllowed] NSEvent lastEvent);
[ThreadSafe]
[Export ("postEvent:atStart:")]
void PostEvent (NSEvent theEvent, bool atStart);
[Export ("currentEvent")]
+ [NullAllowed]
NSEvent CurrentEvent { get; }
[Export ("sendEvent:")]
@@ -804,6 +811,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void UpdateWindows ();
[Export ("mainMenu", ArgumentSemantic.Retain)]
+ [NullAllowed]
NSMenu MainMenu { get; set; }
[Export ("helpMenu", ArgumentSemantic.Retain)]
@@ -811,6 +819,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
NSMenu HelpMenu { get; set; }
[Export ("applicationIconImage", ArgumentSemantic.Retain)]
+ [NullAllowed]
NSImage ApplicationIconImage { get; set; }
[Export ("activationPolicy"), Protected]
@@ -826,9 +835,11 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
bool SendAction (Selector theAction, [NullAllowed] NSObject theTarget, [NullAllowed] NSObject sender);
[Export ("targetForAction:")]
+ [return: NullAllowed]
NSObject TargetForAction (Selector theAction);
[Export ("targetForAction:to:from:")]
+ [return: NullAllowed]
NSObject TargetForAction (Selector theAction, [NullAllowed] NSObject theTarget, [NullAllowed] NSObject sender);
[Export ("tryToPerform:with:")]
@@ -836,14 +847,14 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
[Export ("validRequestorForSendType:returnType:")]
[return: NullAllowed]
- NSObject ValidRequestor (string sendType, string returnType);
+ NSObject ValidRequestor ([NullAllowed] string sendType, [NullAllowed] string returnType);
[Export ("reportException:")]
void ReportException (NSException theException);
[Static]
[Export ("detachDrawingThread:toTarget:withObject:")]
- void DetachDrawingThread (Selector selector, NSObject target, NSObject argument);
+ void DetachDrawingThread (Selector selector, NSObject target, [NullAllowed] NSObject argument);
[Export ("replyToApplicationShouldTerminate:")]
void ReplyToApplicationShouldTerminate (bool shouldTerminate);
@@ -852,7 +863,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void ReplyToOpenOrPrint (NSApplicationDelegateReply reply);
[Export ("orderFrontCharacterPalette:")]
- void OrderFrontCharacterPalette (NSObject sender);
+ void OrderFrontCharacterPalette ([NullAllowed] NSObject sender);
[Export ("presentationOptions")]
NSApplicationPresentationOptions PresentationOptions { get; set; }
@@ -861,10 +872,11 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
NSApplicationPresentationOptions CurrentSystemPresentationOptions { get; }
[Export ("windowsMenu")]
+ [NullAllowed]
NSMenu WindowsMenu { get; set; }
[Export ("arrangeInFront:")]
- void ArrangeInFront (NSObject sender);
+ void ArrangeInFront ([NullAllowed] NSObject sender);
[Export ("removeWindowsItem:")]
void RemoveWindowsItem (NSWindow win);
@@ -879,7 +891,7 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
void UpdateWindowsItem (NSWindow win);
[Export ("miniaturizeAll:")]
- void MiniaturizeAll (NSObject sender);
+ void MiniaturizeAll ([NullAllowed] NSObject sender);
/// To be added.
/// To be added.
@@ -888,17 +900,19 @@ interface NSApplication : NSAccessibilityElementProtocol, NSUserInterfaceValidat
bool FullKeyboardAccessEnabled { get; }
[Export ("servicesProvider")]
+ [NullAllowed]
NSObject ServicesProvider { get; set; }
[Export ("userInterfaceLayoutDirection")]
NSUserInterfaceLayoutDirection UserInterfaceLayoutDirection { get; }
[Export ("servicesMenu")]
+ [NullAllowed]
NSMenu ServicesMenu { get; set; }
// From NSColorPanel
[Export ("orderFrontColorPanel:")]
- void OrderFrontColorPanel (NSObject sender);
+ void OrderFrontColorPanel ([NullAllowed] NSObject sender);
[Export ("disableRelaunchOnLogin"), ThreadSafe]
void DisableRelaunchOnLogin ();
@@ -6590,6 +6604,7 @@ interface NSDockTile {
//Detected properties
[Export ("contentView", ArgumentSemantic.Retain)]
+ [NullAllowed]
NSView ContentView { get; set; }
[Export ("showsApplicationBadge")]
diff --git a/tests/monotouch-test/AppKit/NSApplication.cs b/tests/monotouch-test/AppKit/NSApplication.cs
index 74c7fed4c6db..ff41cc81c93f 100644
--- a/tests/monotouch-test/AppKit/NSApplication.cs
+++ b/tests/monotouch-test/AppKit/NSApplication.cs
@@ -11,6 +11,18 @@ public void NSApplication_SendActionNullTest ()
{
NSApplication.SharedApplication.SendAction (new Selector ("undo:"), null, new NSObject ());
}
+
+ [Test]
+ public void NSApplication_ApplicationIconImageNullTest ()
+ {
+ Assert.DoesNotThrow (() => NSApplication.SharedApplication.ApplicationIconImage = null);
+ }
+
+ [Test]
+ public void NSApplication_DockTileContentViewNullTest ()
+ {
+ Assert.DoesNotThrow (() => NSApplication.SharedApplication.DockTile.ContentView = null);
+ }
}
}
#endif // __MACOS__
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
index 820d784fb440..5d37d6508b67 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
@@ -228,8 +228,6 @@
!missing-null-allowed! 'AppKit.NSDocument AppKit.NSDocumentController::DuplicateDocumentWithContentsOfUrl(Foundation.NSUrl,System.Boolean,System.String,Foundation.NSError&)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSDocument AppKit.NSDocumentController::get_CurrentDocument()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSDraggingImageComponent[] AppKit.NSDraggingItem::get_ImageComponents()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSEvent AppKit.NSApplication::get_CurrentEvent()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSEvent AppKit.NSApplication::NextEvent(AppKit.NSEventMask,Foundation.NSDate,Foundation.NSString,System.Boolean)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSEvent AppKit.NSEvent::EnterExitEvent(AppKit.NSEventType,CoreGraphics.CGPoint,AppKit.NSEventModifierMask,System.Double,System.IntPtr,AppKit.NSGraphicsContext,System.IntPtr,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSEvent AppKit.NSEvent::EventWithCGEvent(System.IntPtr)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSEvent AppKit.NSEvent::EventWithEventRef(System.IntPtr)' is missing an [NullAllowed] on return type
@@ -372,10 +370,6 @@
!missing-null-allowed! 'AppKit.NSViewController AppKit.NSViewController::get_ParentViewController()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSViewController AppKit.NSViewController::get_PresentingViewController()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSViewController[] AppKit.NSViewController::get_PresentedViewControllers()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSWindow AppKit.NSApplication::get_KeyWindow()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSWindow AppKit.NSApplication::get_MainWindow()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSWindow AppKit.NSApplication::get_ModalWindow()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'AppKit.NSWindow AppKit.NSApplication::WindowWithWindowNumber(System.IntPtr)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSWindow AppKit.NSDocument::get_WindowForSheet()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSWindow AppKit.NSEvent::get_Window()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'AppKit.NSWindow AppKit.NSPopoverDelegate::GetDetachableWindowForPopover(AppKit.NSPopover)' is missing an [NullAllowed] on return type
@@ -424,10 +418,6 @@
!missing-null-allowed! 'Foundation.NSIndexPath AppKit.NSTreeController::GetSelectionIndexPath()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSIndexSet AppKit.NSBrowser::SelectedRowIndexes(System.IntPtr)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSNumber[] AppKit.NSPredicateEditorRowTemplate::get_CompoundTypes()' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'Foundation.NSObject AppKit.NSApplication::TargetForAction(ObjCRuntime.Selector)' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'Foundation.NSObject AppKit.NSApplication::TargetForAction(ObjCRuntime.Selector,Foundation.NSObject,Foundation.NSObject)' is missing an [NullAllowed] on return type
-!missing-null-allowed! 'Foundation.NSObject AppKit.NSApplication::ValidRequestor(System.String,System.String)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'Foundation.NSObject AppKit.NSApplication::ValidRequestor(System.String,System.String)' is missing an [NullAllowed] on parameter #1
!missing-null-allowed! 'Foundation.NSObject AppKit.NSBrowser::GetItem(System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSObject AppKit.NSBrowser::ItemAtIndexPath(Foundation.NSIndexPath)' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSObject AppKit.NSBrowser::ParentForItems(System.IntPtr)' is missing an [NullAllowed] on return type
@@ -599,21 +589,6 @@
!missing-null-allowed! 'System.Void AppKit.NSAlert::set_Icon(AppKit.NSImage)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSAnimationContext::set_CompletionHandler(System.Action)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSAnimationContext::set_TimingFunction(CoreAnimation.CAMediaTimingFunction)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::ArrangeInFront(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::DetachDrawingThread(ObjCRuntime.Selector,Foundation.NSObject,Foundation.NSObject)' is missing an [NullAllowed] on parameter #2
-!missing-null-allowed! 'System.Void AppKit.NSApplication::Hide(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::HideOtherApplications(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::MiniaturizeAll(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::OrderFrontCharacterPalette(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::OrderFrontColorPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::set_ApplicationIconImage(AppKit.NSImage)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::set_MainMenu(AppKit.NSMenu)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::set_ServicesMenu(AppKit.NSMenu)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::set_ServicesProvider(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::set_WindowsMenu(AppKit.NSMenu)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::Stop(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::Unhide(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSApplication::UnhideAllApplications(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSArrayController::Add(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSArrayController::Insert(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSArrayController::RemoveOp(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
@@ -683,7 +658,6 @@
!missing-null-allowed! 'System.Void AppKit.NSDatePickerCell::set_MaxDate(Foundation.NSDate)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSDatePickerCell::set_MinDate(Foundation.NSDate)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSDatePickerCell::set_TimeZone(Foundation.NSTimeZone)' is missing an [NullAllowed] on parameter #0
-!missing-null-allowed! 'System.Void AppKit.NSDockTile::set_ContentView(AppKit.NSView)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSDockTilePlugIn::SetDockTile(AppKit.NSDockTile)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSDocument::BrowseDocumentVersions(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSDocument::LockDocument(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
@@ -963,7 +937,6 @@
!missing-null-allowed! 'System.String AppKit.NSSpellChecker::GetLanguage(Foundation.NSRange,System.String,Foundation.NSOrthography)' is missing an [NullAllowed] on parameter #2
!missing-null-allowed! 'System.String[] AppKit.NSSpellChecker::CompletionsForPartialWordRange(Foundation.NSRange,System.String,System.String,System.IntPtr)' is missing an [NullAllowed] on parameter #2
!missing-null-allowed! 'System.String[] AppKit.NSSpellChecker::GuessesForWordRange(Foundation.NSRange,System.String,System.String,System.IntPtr)' is missing an [NullAllowed] on parameter #2
-!missing-null-allowed! 'System.Void AppKit.NSApplication::DiscardEvents(System.UIntPtr,AppKit.NSEvent)' is missing an [NullAllowed] on parameter #1
!missing-null-allowed! 'System.Void AppKit.NSCell::EditWithFrame(CoreGraphics.CGRect,AppKit.NSView,AppKit.NSText,Foundation.NSObject,AppKit.NSEvent)' is missing an [NullAllowed] on parameter #4
!missing-null-allowed! 'System.Void AppKit.NSDocumentController::ReviewUnsavedDocuments(System.String,System.Boolean,Foundation.NSObject,ObjCRuntime.Selector,System.IntPtr)' is missing an [NullAllowed] on parameter #2
!missing-null-allowed! 'System.Void AppKit.NSDocumentController::ReviewUnsavedDocuments(System.String,System.Boolean,Foundation.NSObject,ObjCRuntime.Selector,System.IntPtr)' is missing an [NullAllowed] on parameter #3