Hi Mac developers,

In my quest to compile all fg related packages for 64 bit architecture (x86_64) I finally decided to compile the mac fg start up GUI (FlightGear) for 64 bits. The binary does not work, it starts up and exits with

2010-12-08 00:20:50.408 FlightGear[29071:903] AircraftOptions#awakeFromNib: OSX::OCDataConvException: Cannot register the given selector 'applicationWillTerminate:' as an informal protocol method of type 'v...@0:8...@16', because another informal protocol method is already registered with the same signature (but with another type, 'v...@0:4...@8'. Please rename your selector.
        
/System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/oc_wrapper.rb:50:in
 `ocm_send'
        
/System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/oc_wrapper.rb:50:in
 `method_missing'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/SearchableOptions.rb:41:in
 `awakeFromNib'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/SearchableOptions.rb:40:in
 `each'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/SearchableOptions.rb:40:in
 `awakeFromNib'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/AircraftOptions.rb:37:in
 `awakeFromNib'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/rb_main.rb:38:in
 `NSApplicationMain'
        
/Users/jari/projects/fg/macbundle/FlightGear.app/Contents/Resources/rb_main.rb:38

A 32bit FlightGear will work without any message. The issue is trivially removed by renaming methods named applicationWillTerminate in a few places (see the attached patch for details).

I have search the Net for an explanation for the problem with no success.

Can some one apply the patch to repository https://macflightgear.svn.sourceforge.net/svnroot/macflightgear/trunk/FlightGearOSX ? It resolves the 64bit problem and does not affect i386 binaries.

Another way to resolve the issue is simply to continue compile the startup GUI for 32bit (i386) architecture rather than x86_64. But where is the beauty in that?


Cheers,

Jari
Index: FavoriteOptions.rb
===================================================================
--- FavoriteOptions.rb  (revision 284)
+++ FavoriteOptions.rb  (arbetskopia)
@@ -88,7 +88,7 @@
     end
   end
 
-  def applicationWillTerminate(notification=nil)
+  def theApplicationWillTerminate(notification=nil)
     @dictionary.save()
     super()
   end
Index: FlightGearController.rb
===================================================================
--- FlightGearController.rb     (revision 284)
+++ FlightGearController.rb     (arbetskopia)
@@ -104,7 +104,7 @@
     @path = NSBundle.mainBundle.resourcePath.to_s
 
     notifier = OSX::NSNotificationCenter.defaultCenter
-    {'applicationWillTerminate:' => 
OSX::NSApplicationWillTerminateNotification,
+    {'theApplicationWillTerminate:' => 
OSX::NSApplicationWillTerminateNotification,
       'windowDidBecomeKeyNotification:' => 
OSX::NSWindowDidBecomeKeyNotification,
       'reloadAircraft:' => 'FGReloadAircraftNotification',
       'selectAircraft:' => 'FGAircraftDidSelectNotification',
@@ -247,7 +247,7 @@
     NSNotificationCenter.defaultCenter.removeObserver_name_object(self, 
NSWindowDidBecomeKeyNotification, nil)
   end
   
-  def applicationWillTerminate(notification=nil)
+  def theApplicationWillTerminate(notification=nil)
     # save all the instances of Option
     ObjectSpace.each_object(Option) {|option| option.update(); option.save()}
     Preferences.setValue('advanced', @advanced.state.to_i)
Index: SearchableOptions.rb
===================================================================
--- SearchableOptions.rb        (revision 284)
+++ SearchableOptions.rb        (arbetskopia)
@@ -35,7 +35,7 @@
   def awakeFromNib()
     @table.setDataSource(@dictionary)
     notifier = OSX::NSNotificationCenter.defaultCenter
-    {'applicationWillTerminate:' => 
OSX::NSApplicationWillTerminateNotification,
+    {'theApplicationWillTerminate:' => 
OSX::NSApplicationWillTerminateNotification,
       'synchronize:' => OSX::NSWindowDidBecomeKeyNotification
     }.each do |selector, name|
       notifier.addObserver_selector_name_object(self, selector, name, nil)
@@ -69,7 +69,7 @@
     @table.reloadData()
   end
 
-  def applicationWillTerminate(notification=nil)
+  def theApplicationWillTerminate(notification=nil)
     NSNotificationCenter.defaultCenter.removeObserver(self)
   end
 
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to