I am seeing some strange behavior with NSDate, here is my basic code in a new 
MacRuby project.

I am running on a MacBook 2009 model, Mac OSX 10.6.6

I am using the latest XCode and the MacRuby Framework 0.7 in XCode 

in rbmain.rb:

NSLog("In rb_main.rb")
puts "NSDate = " + NSDate.date.to_s
NSLog( "NSDate = " + NSDate.date.to_s)

CCode.printNSDate

in CCode.m:

@implementation CCode

  + (void) printNSDate
  {
    NSLog(@"In printNSDate, NSDate = %@", NSDate.date);
  }

@end

When compiled: 64-bit Universal, the output is

2011-01-28 05:54:16.972 TestRuby[90066:a0f] In rb_main.rb
NSDate = 2011-01-28 05:54:16 -0600
2011-01-28 05:54:16.976 TestRuby[90066:a0f] NSDate = 2011-01-28 05:54:16 -0600
2011-01-28 05:54:16.979 TestRuby[90066:a0f] In printNSDate, NSDate = 2011-01-28 
05:54:16 -0600

When compiled: 32-bit Universal, the output is

2011-01-28 05:51:23.941 TestRuby[89998:a0f] In rb_main.rb
NSDate = 2011-01-28 05:44:00 -0600
2011-01-28 05:51:23.958 TestRuby[89998:a0f] NSDate = 2011-01-28 05:44:00 -0600
2011-01-28 05:51:23.961 TestRuby[89998:a0f] In printNSDate, NSDate = 2011-01-28 
05:51:23 -0600
2011-01-28 05:51:24.565 TestRuby[89998:a0f] Error loading 
/Library/InputManagers/Smart Crash Reports/Smart Crash 
Reports.bundle/Contents/MacOS/Smart Crash Reports:  
dlopen(/Library/InputManagers/Smart Crash Reports/Smart Crash 
Reports.bundle/Contents/MacOS/Smart Crash Reports, 265): no suitable image 
found.  Did find:
        /Library/InputManagers/Smart Crash Reports/Smart Crash 
Reports.bundle/Contents/MacOS/Smart Crash Reports: GC capability mismatch
2011-01-28 05:51:25.409 TestRuby[89998:a0f] Error loading 
/Library/InputManagers/SIMBL/SIMBL.bundle/Contents/MacOS/SIMBL:  
dlopen(/Library/InputManagers/SIMBL/SIMBL.bundle/Contents/MacOS/SIMBL, 265): no 
suitable image found.  Did find:
        /Library/InputManagers/SIMBL/SIMBL.bundle/Contents/MacOS/SIMBL: GC 
capability mismatch


The Obj-C routine prints the correct time. 5:51:23 in both cases.
For 32 bit, the Ruby code prints some time in the past that never changes.
For 64 bit, the Ruby code prints the correct time.

Any idea's what could be going on?

Thanks!

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to