Bug 4054 - NSDate.DistantPast, Now, DistantFuture , new NSDate() do not work (unrecognized selector)
Summary: NSDate.DistantPast, Now, DistantFuture , new NSDate() do not work (unrecogniz...
Status: RESOLVED INVALID
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-23 03:01 UTC by steven.orth
Modified: 2012-04-25 15:06 UTC (History)
2 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:
RESOLVED INVALID

Description steven.orth 2012-03-23 03:01:04 UTC
Attempting to use NSDate causes unrecognized selector errors.

Example: Trying to use NSDate.Now, new NSDate(), et. al. causes:

2012-03-23 01:51:32.219 ShellTestApp[90506:1007] -[__NSDate length]: unrecognized selector sent to instance 0x7ae2c20
2012-03-23 01:51:32.234 ShellTestApp[90506:1007] -[__NSDate length]: unrecognized selector sent to instance 0x7ae2c20
2012-03-23 01:51:32.237 ShellTestApp[90506:1007] (
	0   CoreFoundation                      0x94751b67 __raiseError + 231
	1   libobjc.A.dylib                     0x97d27149 objc_exception_throw + 155
	2   CoreFoundation                      0x94755170 -[NSObject doesNotRecognizeSelector:] + 256
	3   CoreFoundation                      0x946a3da9 ___forwarding___ + 457
	4   CoreFoundation                      0x946a3b72 _CF_forwarding_prep_0 + 50
	5   CoreFoundation                      0x94613c1a CFStringGetLength + 106
	6   CoreFoundation                      0x9462bf02 CFStringCompare + 18
	7   HIToolbox                           0x97e7f0e8 RunCurrentEventLoopInMode + 167
	8   HIToolbox                           0x97e86412 ReceiveNextEventCommon + 168
	9   HIToolbox                           0x97e86356 BlockUntilNextEventMatchingListInMode + 88
	10  AppKit                              0x91701a9c _DPSNextEvent + 678
	11  AppKit                              0x91701306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
	12  ???                                 0x07deff74 0x0 + 132054900
	13  ???                                 0x07defdcc 0x0 + 132054476
	14  ???                                 0x079abd2b 0x0 + 127581483
	15  ???                                 0x079abc90 0x0 + 127581328
	16  ???                                 0x0174782c 0x0 + 24410156
	17  ???                                 0x017cafac 0x0 + 24948652
	18  Foundation                          0x9c480e25 __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 49
	19  CoreFoundation                      0x94691cb3 ___CFXNotificationPost_block_invoke_1 + 275
	20  CoreFoundation                      0x9465ca38 _CFXNotificationPost + 2776
	21  Foundation                          0x9c46c012 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
	22  Foundation                          0x9c4812a6 -[NSNotificationCenter postNotificationName:object:] + 55
	23  AppKit                              0x9176bf36 -[NSApplication sendEvent:] + 4355
	24  AppKit                              0x916fd6d5 -[NSApplication run] + 1007
	25  AppKit                              0x91991261 NSApplicationMain + 1054
	26  ???                                 0x02cc5430 0x0 + 46945328
	27  ???                                 0x02cc5378 0x0 + 46945144
	28  ???                                 0x004a6e20 0x0 + 4877856
	29  ???                                 0x004a6edf 0x0 + 4878047
	30  ShellTestApp                        0x0000d282 mono_jit_runtime_invoke + 722
	31  ShellTestApp                        0x001a436a mono_runtime_invoke + 170
	32  ShellTestApp                        0x001a6f01 mono_runtime_exec_main + 705
	33  ShellTestApp                        0x001a6111 mono_runtime_run_main + 929
	34  ShellTestApp                        0x00069995 mono_jit_exec + 149
	35  ShellTestApp                        0x0006bf13 mono_main + 9587
	36  ShellTestApp                        0x00002299 main + 441
	37  ShellTestApp                        0x000020a6 start + 54
)
Comment 1 Miguel de Icaza [MSFT] 2012-04-24 00:20:16 UTC
Works fine for me:


mac$ csharp -r:MonoMac.dll
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> using MonoMac.Foundation;
csharp> var d = new NSDate ();
csharp> d
2012-04-24 04:18:53 +0000
csharp> NSDate.Now;
2012-04-24 04:20:03 +0000
Comment 2 steven.orth 2012-04-25 15:06:23 UTC
Works for me now, too, w/ latest MonoDevelop / Mono push.
Thanks!