Bug 14231 - NSNotificationQueue.DefaultQueue is bound as NSObject
Summary: NSNotificationQueue.DefaultQueue is bound as NSObject
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.4.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-25 17:08 UTC by tome
Modified: 2014-04-07 06:02 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description tome 2013-08-25 17:08:51 UTC
I guess this signature is wrong.
The static member DefaultQueue of NSNotificationQueue class returns it as an NSObject.
Surely I confirmed that it works as an proper instance of NSNotificationQueue like following code snippet;

var notification = NSNotification.FromName ("ANotificationWhichPostWhenIdle", null);
var que = new NSNotificationQueue (NSNotificationQueue.DefaultQueue.Handle);
que.EnqueueNotification (notification, NSPostingStyle.PostWhenIdle);


Or Is there any restriction or recommendation that it should not be used or somewhat.
Thank you for your help.
Comment 1 Sebastien Pouliot 2013-08-26 10:55:53 UTC
Yes, I tracked the original commit (3 years old) and it's a binding mistake. It should return a `NSNotificationQueue`. 

I'll fix this for future releases, but you can safely cast it for `NSNotificationQueue` in existing applications.
Comment 2 Sebastien Pouliot 2013-08-26 11:14:52 UTC
Fixed in master 255ea661ae9cc20e918cda9829de0255b37ba947
Comment 3 Ram Chandra 2014-04-07 06:02:30 UTC
I have checked issue on following builds:

Mac OS X 10.7.5
Xamarin.iOS: 7.2.2.14 (Trial Edition)
Xamarin Studio: 4.2.3 (build 60)
Build Information
Release ID: 402030060
Git revision: 30c4afc300c2a39ec5300851357ce02e49dd217e
Build date: 2014-03-05 22:09:33+0000
Xamarin addins: f8a9589b57c2bfab2ccd73c880e7ad81e3ecf044

To verify this issue I have check the definition of static member "DefaultQueue" of "NSNotificationQueue" class in assembly browser and I observed that the static property "DefaultQueue" doesn't return "NSObject" now it's returning an object of "NSNotificationQueue" class

Screencast: http://www.screencast.com/t/UxUl2hOxp4

This issue is working fine. Hence, I am closing this issue.