Linking Controller to Window in Xcode with MacRuby
Using Xcode 4.3.2 and MacRuby .10, I start up a new MacRuby project and create a file called SetupWindowController.rb, which houses this code:
class SetupWindowController < NSWindowController
attr_accessor :window, :submit, :path_to_root
def set_root_path(sender)
end
end
In the .xib file, I drag an Object onto the bar with App Delegate, File's Owner, and the Windows, but when I try to set it's class to SetupWindowController... nothing.
What could be causing this?
this is actually an issue with the version of Xcode you are using. Xcode is now installed in a different path (/Applications instead of /Developers) and Xcode calls a MacRuby script to get the information about the available classes and methods written in Ruby. Because of the path change, this call fails and Xcode doesn't see your outlets or actions.
To fix this issue you need to update MacRuby to the latest build which would be the nightly build available there: http://www.macruby.org/files/nightlies/macruby_nightly-latest.pkg
0.12 is about to be released (0.11 is going to be skipped), but the nightly build is very stable.
链接地址: http://www.djcxy.com/p/60488.html